1 00:00:02,410 --> 00:00:04,900 There also are more things you can set up of course, 2 00:00:04,900 --> 00:00:11,170 one thing I want to dive into are the over the air updates though which you control with the updates 3 00:00:11,170 --> 00:00:12,610 key in the app.json file. 4 00:00:12,620 --> 00:00:19,600 Now that's a neat feature, which means that people running your app on their device no matter if it's 5 00:00:19,600 --> 00:00:24,970 just running in the expo client because they scan such a barcode which as I mentioned isn't too useful 6 00:00:25,390 --> 00:00:28,040 or if they really downloaded it from the app stores, 7 00:00:28,090 --> 00:00:33,700 as long as you build your app in the managed expo workflow, you get the over the air update functionality 8 00:00:33,700 --> 00:00:38,830 built in and that means that if you change something in your code, let's say here on this screen we change 9 00:00:38,830 --> 00:00:44,230 something, we change some titles, some functionality or we even add a brand new native module, 10 00:00:44,230 --> 00:00:52,900 no matter what you do, whenever you publish this update with the expo publish command, all your users, 11 00:00:53,050 --> 00:00:58,810 even if they installed the app from the app stores will get this update in their app the next time they 12 00:00:58,810 --> 00:01:00,160 open the app 13 00:01:00,160 --> 00:01:06,160 and that's important. You can configure the functionality here in the updates key. Again in the official 14 00:01:06,160 --> 00:01:11,560 docs, you learned more about this update key and what you can set there. What you can set, 15 00:01:11,560 --> 00:01:15,790 for example is if it's generally enabled which by default it is 16 00:01:15,790 --> 00:01:22,600 and with this fallback to cache timeout thing, you can configure how long the app when users launch it 17 00:01:22,630 --> 00:01:29,620 on their device should check for updates and try to load them before it displays the recent available 18 00:01:29,710 --> 00:01:35,620 version. By setting this to zero, you're saying whenever the app launches, it immediately displays what 19 00:01:35,620 --> 00:01:41,830 it has. It looks for updates behind the scenes and for the next launch, it might then take them into account 20 00:01:42,190 --> 00:01:47,500 but it doesn't try to look for updates and download them before actually loading the app. 21 00:01:47,510 --> 00:01:50,420 Now you could change this to let's say five seconds, 22 00:01:50,440 --> 00:01:55,790 this is a millisecond value, so five thousand milliseconds which is five seconds. 23 00:01:55,810 --> 00:02:01,360 This would mean that when people launch the app, they will see the launch screen for up to five seconds 24 00:02:02,020 --> 00:02:08,920 which is of course quite long because after loading everything else, expo or your app tries to look for 25 00:02:08,920 --> 00:02:13,870 an update and if it finds an update, it tries to download it and take it into account. 26 00:02:13,990 --> 00:02:19,150 That might be done in five seconds, it might be done faster in which case your app will also launch 27 00:02:19,150 --> 00:02:24,700 faster but if it takes longer than five seconds, then it'll continue with the updating but not immediately 28 00:02:24,710 --> 00:02:30,370 load it but instead load the most recent version that is available. Now it's of course up to you what 29 00:02:30,370 --> 00:02:31,690 you prefer, 30 00:02:31,690 --> 00:02:37,510 this approach makes sure that users have the fastest possible startup experience but they only get your 31 00:02:37,510 --> 00:02:40,830 updated code the next time the app is launched. 32 00:02:40,990 --> 00:02:48,010 This approach or setting this to an even higher value like 10 seconds means that users get newer versions 33 00:02:48,130 --> 00:02:53,710 more frequently or quicker because they get it on the next app launch already 34 00:02:53,800 --> 00:02:58,990 but the downside is that the app launch might take a bit longer, which is maybe not what you want. 35 00:02:58,990 --> 00:03:03,760 So it really depends on which type of app you're building and which type of users you're targeting, what 36 00:03:03,760 --> 00:03:04,840 you want to set there. 37 00:03:04,840 --> 00:03:10,780 If it's a business app let's say which you distribute to your employees which needs to be updated all 38 00:03:10,780 --> 00:03:14,620 the time and where the user experience is not that important, 39 00:03:14,620 --> 00:03:17,710 you might want to take a value like 10 seconds here, 40 00:03:17,710 --> 00:03:25,880 if it's an app you share with normal end users around the world, you might want to go for a faster start 41 00:03:25,880 --> 00:03:31,220 up time to provide a good user experience and sacrifice update speed for that, 42 00:03:31,390 --> 00:03:36,190 so users would then only get the update on the next launch after this launch. 43 00:03:36,190 --> 00:03:43,300 With all of that out of the way, let's actually have a look at all of this and also at this over the air 44 00:03:43,300 --> 00:03:44,260 update feature. 45 00:03:44,260 --> 00:03:48,990 I changed a couple of settings here and therefore what I'll now do is I'll run expo publish again, 46 00:03:49,120 --> 00:03:53,840 still that's the command which will not get it in the app stores but which will share it 47 00:03:53,890 --> 00:04:02,620 here on this expo page so to say. So I run this command and we could have still optimized our assets 48 00:04:02,620 --> 00:04:04,610 with expo optimize 49 00:04:04,660 --> 00:04:09,010 but since we don't really have images included in the app other than the icons here which are generated 50 00:04:09,040 --> 00:04:12,850 and optimized by expo anyways, this shouldn't be a problem, 51 00:04:13,000 --> 00:04:18,460 so I can just run it like this and wait for this to complete and then I will test this on an Android 52 00:04:18,460 --> 00:04:23,420 device because there, the advantage of course is that we can use this barcode here. 53 00:04:24,370 --> 00:04:30,490 So now once this is finished, the cool thing is we'll immediately have this new app available by scanning 54 00:04:30,490 --> 00:04:36,370 this barcode and thereafter, I'll show you how we can get over the air updates without even scanning 55 00:04:36,370 --> 00:04:41,280 the app barcode again because that's the idea, we get any updates without scanning again, 56 00:04:41,320 --> 00:04:46,720 it's pushed to our app the next time we launched the app. So let's wait for this publish process to 57 00:04:46,720 --> 00:04:52,240 finish and the URL is still the same as before because I haven't changed anything about my slug here 58 00:04:52,270 --> 00:04:54,570 which is part of the that URL or anything else. 59 00:04:55,540 --> 00:05:00,730 So now here's the expo app on my Android device where I can now scan this barcode and therefore now 60 00:05:00,730 --> 00:05:10,330 the app launches here on Android. Now you see I got the splash screen, I got the app running here and I can 61 00:05:10,330 --> 00:05:16,600 of course also use it, for example I can take an image here. So that all works the way it should work 62 00:05:16,720 --> 00:05:18,730 on my device here 63 00:05:18,820 --> 00:05:22,210 and now let me show you this over the air updating functionality. 64 00:05:22,270 --> 00:05:24,940 See that add place title here at the top? 65 00:05:24,940 --> 00:05:27,060 Now let's change that in our code. 66 00:05:27,070 --> 00:05:28,470 So let's go to the code here 67 00:05:28,630 --> 00:05:33,460 and on the screen here in the new place screen where we set this title, 68 00:05:33,580 --> 00:05:37,460 let's change this to add new place, 69 00:05:37,500 --> 00:05:40,170 it's a tiny change but still. 70 00:05:40,170 --> 00:05:45,540 So now if I run expo publish again, this app will be bundled up and will be published to 71 00:05:45,660 --> 00:05:47,800 the expo servers again. 72 00:05:47,880 --> 00:05:52,770 So let's wait for this process to finish and it's done 73 00:05:52,770 --> 00:05:54,590 and now let me show you this live updating. 74 00:05:54,600 --> 00:05:55,880 I still have the app running here, 75 00:05:55,890 --> 00:06:01,670 so of course this does not change whilst the app is running, so of course here we still have the old title. 76 00:06:02,040 --> 00:06:04,390 But now let's say I was away quite a time, 77 00:06:04,400 --> 00:06:08,380 I closed this here and now I relaunched the app. 78 00:06:08,610 --> 00:06:14,720 If I now go to the new places screen, I still see the old title. 79 00:06:14,920 --> 00:06:18,780 Now that makes sense if you think about the updating strategy we used. 80 00:06:18,780 --> 00:06:24,500 I made sure that the app launches as quick as possible and downloads a new update behind the scenes, 81 00:06:24,510 --> 00:06:25,470 so that's what happened 82 00:06:25,470 --> 00:06:30,980 now, this was the first relaunch of the app on my device after updating it. 83 00:06:31,050 --> 00:06:36,330 So let's say I'm again away quite some time and I relaunch it again, by the way here you can see the 84 00:06:36,330 --> 00:06:38,930 adaptive icon in action. 85 00:06:39,080 --> 00:06:44,600 Now if I go to that screen, you'll see add new place as a text because now this is the second 86 00:06:44,600 --> 00:06:47,210 launch after the update. In the first launch, 87 00:06:47,210 --> 00:06:52,020 we downloaded the update and installed it so to say, in the second launch we're using it. 88 00:06:52,160 --> 00:06:57,800 Now the app on the device technically didn't change, just what's in there changed, our Javascript code 89 00:06:57,800 --> 00:07:04,670 changed and since we have this expo wrapper, this means that expo can take this into account and use 90 00:07:04,670 --> 00:07:05,290 this new code 91 00:07:05,810 --> 00:07:10,730 and this will also work if you publish your app to the app stores because there whilst you will build 92 00:07:10,730 --> 00:07:16,800 a standalone app and people won't need the expo client, you will still include that expo client app into 93 00:07:16,800 --> 00:07:17,800 your standalone app 94 00:07:17,810 --> 00:07:18,860 as I mentioned earlier, 95 00:07:18,920 --> 00:07:24,710 so your standalone app kind of has the thin expo wrapper the expo client built in and wrapped around 96 00:07:24,710 --> 00:07:25,220 your app, 97 00:07:25,250 --> 00:07:28,030 that's why over the air updates will even work there. 98 00:07:28,070 --> 00:07:30,440 And speaking of that, we now test this a lot, 99 00:07:30,440 --> 00:07:36,150 we tested this all with just expo and with scanning the barcode. 100 00:07:36,170 --> 00:07:41,180 Now let's dive into how we can really build this app and publish this app for the app stores.