Transcript for:
Enabling Install Updates in F Apps

uh enableing install updates in F apps with show Mike johnney with cush so I'm masahi I'm found founder of the open C free cicd service for f and if you have some interest about open C you can go to the opci io and because it is close better you can join our Discord Channel if you are interested and I was a former software engineer at IBM and a startup co-founder CDO and as me as mention you uh I just became an organizer of FR Tokyo uh a few hours ago so if you have chance to come to Japan let's do some FR meetups of course I have loved FL and that for five years yeah and I'm best in Tokyo in Japan so disclaimer all demos are run by MacBook Pro M Max 64 GB 10ar iPhone 12 pixel Pro and I'm not a member of the sh Cham nor have I received any money just user and today's goal is to understand uh what cfish is uh how the Sho works and how to use Sho even in production environment and the pricing of the showbo so I have some questions about Sho so answer them and win Dash so first what is frer so as you know frer is an open source framework by Google for building beautiful natively compiled M platform application from a single code base and F is read in do and you can distribute the BR app to many platforms like iOS Android web Linux Mar windows and even TV OS yes router runs everywhere and with one Cod base great isn't it and what is cod push so the show Cham explained cush Cod push as follows Cod push is a tool that allows you to update your f app instantly over the air without going through the store update process and this allows you to direct to develop uh deploy fixes and new features to your end user devices and uh please raise your hand if you have experience submitting apps to Apple or Google yeah okay most of them have their experience okay so in the normal process of uh reviewing uh for fixing back first you find a back and uh fix them and upload the build to the stores up on the Google stores and submit the review to them and wait for the store uh approval and if you are lucky or request and expected review the store approves your build in a few hours however in most cases as you know this will take a few days and if you are so unlucky you have to wait days weeks or even months and uh after the store approval you can res aild to the store finally the users get an update the problem is that uh you must wait for the store review and can't know when the store approves your app and sometimes your app will be rejected for other reasons overall I think no one likes this review process on the other hand if you use cod push uh you don't have to care about the stores after fixing backs all you have to do is send code uh send a code to the users I think you can wait up to 10 minutes to the about update to the users Cod push demo so first I'll show you how the Cod push works the first screen is original FL counter that after killing the app that Cod push was made so the screen became block this doesn't use five Bas remote config or launch lockery or simar service I will show that sh Cham and the sh the only Cod Push service for frer is developed uh by frer Heros as you know Eric is a founder of frer and the former director of engineering for FR and do are Google and F is very popular for the blog Library which is a most famous one of the most famous State Management packages in Fr and Brian is a former FR Cham member and the is the fr. GTE and the frame cor member the first Cas uh with the app uh with the app on the Google Store views become unnecessary with cold push please raise your hand if you think a is the answer a few okay okay okay how about B okay most of us okay the answer is no I explain the reasons so with code push you can change any do code this is an example of the def counter app the blue line is original and the red line was deled and green light was added in other words you can change the fra viset code for example you can change fra visits like color text size and business logic WR in dot however you have to care about the number of change es the more the code you change the larger the the part size will be however you cannot change a native code for iOS it is Swift or cutl for Android I don't know Swift objective c for Android it is cutting on Java due to the apple and Google's store requirements and these are the croud packages and uh if you upgrade fire store or your launcher you canot use you cannot use card push because they have uh native code changes this means that if you upgrade those uh packages with no native code change you have to submit the build to the store and wait for the store approval but you can upgrade your uh the provider or block which are pure do packageing and use called bish if you change assets for example adding a new image widget and the jpeg or ping image to flut technically you can use C push however sha doesn't support assets right now unfortunately the assets suppose has no TAA at the moment since after sh's iOS table release the cham has been too busy meeting the new customers requirements this is not uh directly related to the quiz but because it is very important I explain with code push technically you can change any do code this means that you can change uh app features without the submitting up store views for example you submitted to the app and the store accepted it then you can send the code push at the main functionality is a too then you modify the code to change up features to like the dating app then you can say the code pish to reflect these changes in this case you deceive the source this is not allowed for Apple and Google and if you do this your app will be banned from stores and showbo and another example is changing inner provide uh inner purchase providers if your app has I AP prod providers and the contents are digital uh the transaction fee is up to 30% 30 however with a code push after the store review approval you can change IAP providers to like stripe to reduce reduce the fees to 3% uh this is also technically achievable but it's not allowed okay shoard architecture I explain how the Sho works the first first sh is a fork of f the reason sh CH uh Fork the frud is to implement cold push functionality as you know uh FR itself doesn't have the cold push for your information Eric the found of FR and Shir had attempted to implement cold push for FR but the pr wasn't matched the next question uh is to check your understanding of the how the cold push works [Music] so so can can you use cod push to update the content of an existing app uh buil by frer if your app is listed in the stores can you use code push to update app what do you think so a yes okay okay how about B okay the answer is no so but you you can take use the Cod pit but uh I explain the details you you can use cod pit for existing apps uh built by F the app listed in app store and play store was built by FR as I said it doesn't have the functionality to update app contents in other words the app in the store doesn't have the uh Cod Bush functionality the the app cannot get updates from the Sho server no reflect changes to the app so I think you can get an overview how sh sho works so I dive deep into it so Sho consists of the three parts the first component is a sh CLI a command line interface that emps you to create build perform code push and more the interface is primary tool you use when working with showboard offering the S line and efficient way to manage your Cod push operations the modified Val engine the heart of the Sho is where the magic happens the sh chain with the ingenious use of C++ and rust have enabled cord push in the F engine understand understanding the modification may be challenging but it's a journey that that's sure to inspire the last part is a cloud infrastructure this manage called p and usage of the showboard the Sho CLI this slaps the original product command and as a few Sho commands so sh's creating shs creating IPA file command is very similar to the frb IPA and the code of the CLI is open source for transparency so you can go to the sh repos and check the code and as I said the CLI is a just wrapper of the F command so you can use a f commment with a sha CLI and I explain this later the this is the most challenging and fun part I explain this as much as possible but if you need more details please head over to show about Dev or do and Discord uh and there isn't an issue to add more explanation so sh takes a unique approach by foring f/ engine also known as the F engine and adding a Sho updator in other words to enable Cod push they for the FL engine then add a shoard updator and they also modified f/ the F framework and the f/b root know as the build rout for COD push to work the crowd infrastructure is divided into three key components R binary uh stray patch binary stray and the check request these components are designed to ensure simless operation of their services they to release artifacts such as IPA for iOS and the Apple bundle for Android in private stage and the four part which is diffs from the revie they are stored in the stret and sub via Global CDN this section will provide instruction to how to use stot so before using Sho you have to create a Sho account it's free so don't worry then install Shard CLI using the common line above and once you've installed The Shard you can use it to log in the C will generate a login link for you which you can then use it to log in through the browser when you log to Sho and navigate to the projector Ro Direct Dory run shard in it this will create Shard do yo file at the root of your project which contains sh's app ID this app ID is what connects your app to Shard so if your app has multiple flavers such as staging and production a corresponding number of app ID will be created and you can check the status of of these apps on the shat web dashboard and it is important to know for note that for Android using sh requires internet permission so if you Android manifest.xml doesn't allow the permission sh in it with automatically modified the code to ensure the necessary access is granted this step is crucial for the Sim operation of shard in new app and the next comment is a sha re for Android uh run sha re Android roid for iOS sha release iOS and for iOS it creates IPA for Android it creates Apple bundle after creating this artifact you can upload it to App Store connect Play Store or five Bas app distribution to use original fow command you can use double hyphone like the sh reies iOS H Hy space dode blah blah blah and the pr be careful that uh these release comments produce only release build not that uh not the dev or not a profile build so if you forget I will explain the build modes of FL in FL there are three build modes uh debu profile and release debu mode is for debuging the app so you can use hard REO to check the uh app and but the performance is worse than the release and the profile mode is for uh checking the app performance and relas mode is for uh distribution so the performance is the best for the relase mode and since the release command of the sh is only for release so you cannot check the build on your iOS simulator or Android emulator and success fre running the sh registered release to the sh server so that it can be used for C push at the console you can see the message message indicating that your build new build is registered on the sh server to check the build you can use a sh preview command this the advantage of using this command is that it is super fast as you see after running sh about preview you can choose which build to preview on your phone then the C downloads the artifact from The Shard server and install it to your phone and since the CLI only downloads of installs not builds if your internet speed is fast enough the preview is fast but you can use Shard uh preview only on your machine so if you want to test a build across your team use test F Play Store test track or five Bas up distribution and there is a staging argument with and with this argument you can check the staging patch so when you want your dat update to the end users app in other words you want to push your card you can use shat patch Android for Android shat uh iOS for iOS and the sh patch has one argument which is staging as mentioned earlier you can patch with a staging argument why is this so important the the answer is straightforward when you run Shard patch the update is registered on Shard server this means that when an ex existing user opens the app it will automatically update however if the patch has back the user will also encounter these bags this is where the station argument comes in by using it uh you can avoid this potentially problematic situation in the production environment when uh patching using the station and checking the preview command are much safer than patching diory after using the staging argument confirming that uh your patch works fine head to the Sha console where you find the go live button and press it to send update to the users and I would let me dive deep into the patching one of the key steps is in the patching process is running the sh of patch command this commment uh generates an artifact and send it to the Sha's Google Cloud stage the app built by Sha rele not F build checks patch updates every time the app start with a get request to show us sub which runs Google Cloud run and if the response indicat an update is available the app downloads the artifact using the Shas response download URL then the update reflect the change to the app and the updating process is done in an isolated State not a main state so as not to block the frer UI as you know fra is a single threaded so if you run heavy processor in main threaded like downloaded outa uh you have free it so this approach is necessary so the pricing of the Sho is very generous you get 5,000 purches every month for free and after that it's p as you go the hobby plan includes one developer so if you want to invite other developers to your Sho account you must use the chimp PL which includes unlimited developers the last question is about pricing so how many patches will be made if you code push one upate to 10,000 users okay please raise your hand if the answer is a okay half of maybe half of them how about B yes it's good Cor question yeah okay the answer is 10,000 patches so you cannot use a hob plan for this situation you can use uh yeah you have to pay some and if your existing app has many uses I think the cost can be huge so but maybe the sh Cham can discount the price so feel free to discuss the cost with them yes and the show suppos gith have actions and the Cod match for cscd of course you can use a cicd Services though it may be challenging like EXO Cloud bit flight scii at open C we suppos Sho and as mentioned earlier you can Implement Sho into the cicd workflow using Sho and using shard in GitHub action is really easy and simple since The Shard team has already developed the GitHub actions however the most difficult part is to how to use Sho in C CD and make sh relase how to make the sh relase and pches in the CCD pipeline so I will show you three examples and the first is the shch recommendation the def branch is main this work for is triggered when the r branch is created or patched pushed and in thiso there is an environment variable sh token this is retrieved from running sh login and when creating new R branch this workflow runs sh release for pushing an existing release Branch sh PCH runs this workflow is only for Android so if you need to prepare so you need to prepare for the iOS B pro and however as you may know MOS of the m in instance of the GitHub actions is really expensive so you can use you can consider using the code magic or opci they are much cheaper and yes open C is free and the next showcase is from one of my clients they use open c as your cicd they are pre startup the def branch is developed when creating PR to develop CI triggers and it runs sh with IOS and Android with internal flavor then deploy the build to the Firebase up distribution for testing when QA they Marge devop into the main blanch and the for OP build to the stores when creating release Branch from Main that c triggers and it runs sh by release with stable flavor and then deploy the vi to uh Apple Store and play store for patching ping the r branch is a SE trigger when the trigger P use sh PCH is fun as you may notice they no longer use a original fra build command only Sho release so if you want to compare Sho and F build you can also set up the original work work for and this example comes from one of my other clients and they have only two FL devs and see run startup the def brunch is Main and when available they use sh patch to update up for PR they relase sh about build with staging and production flavor and distribute them to the five sub distribution future world map so sh Chim is now really working hard to improve iOS performance and fixing bus so unfortunately this support asset support and faster integration support uh are planned but no ETA and uh frequent ask FAQ so any performance difference difference between native F and Sh uh I have not seen any issues with our performance for Android however there slight difference between F build and Sh build for iOS the sh Cham insists that sh for iOS is production ready and I agree with their opinion so for more details is issue 1825 and for the up size iOS doesn't have a problem however for the Android APK uh the size can be bigger than the FL so be sure to check the size before releasing the build to your uh users so thing I have to say is uh sh is production ready and I agree with this but uh honestly speaking it's not much in a service like a FL so they need more jgs and maybe you will encounter a fatback so be careful and do enough testing before using Sho in production fortunately the Sho Cham is very kind helpful and quick to respond to yes that's it and uh I was some souven for Japan so they are chocolate and cookies and uh this is a price time so please raise your hand if you correct all the questions please who who correct all an okay okay thank you thank you so I through the dash please raise your hand [Laughter] okay and Y yes and one more dashes okay Cong congratulations and I have some t-shirs and Japanese yeah chocolate cookies so yeah and uh I have some more surprise uh even if you cannot get prize I have one more surprise for you I ask the shop Chim to create a coupon for you and of course you can start using Sho for free but as I men mention it is limited to one developer so this B is uh one free for the CH PL so you can try shard in your Cham but be careful this gift expires on May first and again I'm just sober user and I'm not getting any money from them and special thanks to them uh I'm deep deeply grateful to my esteemed clients Al sham I love for their inviable insight into sh production the sh seem support has been instrumental in my deeper understanding of the shers and I am immensely grateful the for the connection team for the opportunity to speak at this prestigious conference it is an honor I still find hard to believe and rahou uh your encouragement to submit cfp for this conference and your inviable insights have been transformative for me I'm I'm really grateful for your support and the mar always helps me uh organize my slide talks and supports me yeah so these are my SN links feel free to connect with me if you come to Japan let's grab some tea thank you so much thank you very much we have time for a couple questions or a couple there there's like a bunch of questions on the slid thanks a lot so the yeah there are like a lot of question we will send them all to you and probably to the shaer team too so they can help you answer uh the first one uh is how Apple and Google would know that you are actually respecting the 3.2.2 paragraph are they watching your app I think uh they don't know yeah so that that is a reason I talk about do not deceive the stores yeah maybe some your competitor will report that your Cod person you change the up main up features maybe this is uh one possible way to they know that deceive the stores yeah well you can try and play but if you lose then you lose big yeah maybe maybe it's too big too big a bet um yeah the second one is uh have you encountered any expected unexpected limitations like in compatibility with Native FL tooling uh while developing using shird I'm guessing because it's fork and shouldn't be any but do you have uh for now I haven't experienced the difference between yeah the native but the the sh te to to uh sometimes uh uh said that the native FL uh to output is not useful for the sh so they have to some modific they have to add some modification for the output or the FR recommend yeah an interesting question about the usage you would recommend um would you actually recommend uh a shortboard for updates of your app I mean no matter the update or just for pushing uh crucial fixes in case you have like you know some major bug uh okay uh I think you should try updating up yeah uh if your app doesn't have the native code changes and uh if you run the uh sh patch sometimes you the warning from the sh will appear and uh for my advice don't ignore the warning because if you ignore the warning maybe you up with clash and one one of my clients experience the yeah crashing so don't uh ignore the warning um by the way uh do you have a way to uh limit the uh users that you push to pouch to like let's let's assume you have I know 20,000 users but you want just you know 100 users or a thousand users to receive the okay I think there's no way so uh but I think there is an issue or so you have maybe it's better to ask sh Chim about that because if your app has 300,000 uses maybe the cost can be fused M yeah yeah because I mean you can use a sh but I think for AB testing you want to test a small feature to number small number of users M maybe so in that case uh using the flavor is a better option so for all the plants you can uh make uh unlimited number of the uh apps yeah so you can use the flavors um another practical question can you combine uh Shir CLI with a flutter management version system like fbm um that's good question I haven't seen this kind of uh comments in the sh Discord I think you cannot use the fvm with the sh CLI but I uh there is a show uh the argument of setting the FL version of the Sho so you can use the argument yeah like SHO version uh 3.19 yeah five something like that okay I'm guessing if it's a fork of FL it's using version defined by the CLI of Rober so you can pass a tag to the version but it wouldn't make sense to be able to choose from the version that you have locally I guess thanks uh you have another one oh uh there are like 20 Questions okay well you can ask me any any time when I'm free maybe one one last one that was uh that had the many votes um would you recommend to uh always after pushing a patch would you recommend to always push uh push a new release uh with that same patch uh we've heard of some performance issue uh impact on on a patch so is it a best practice to push a patch to make sure that user does the the bug is fixed uh and then afterwards uh when the bug is actually fixed after fixing a fixing a box of shortboard no no or a box over the app no uh you're fixing a bug to in your application using a shortboard patch and afterwards should you push a new release to make sure that you have a new stable version that is not patched but uh actual new release I think it's better to if you can you have to submit a new version of the yeah uh build with SH R not patching because maybe they have the native C changes but is it considered the best practice to do this every every time you do a patch a few days later to have a new release or not necessarily and you can push some patches in a in a batch uh I it it it depends but for I think I I it's better to patching every time because uh it reduce the development time and uh it reduces the chance of the rejecting from the stores yeah so for the business and for the customers I think it's better option to yeah use patch every time yeah definitely seems safer that way yeah thank you very much masah hero and let's have lunch yeah thank you so much