App slow to open with slow connection

#1

The app opening seems to be very slow when using a slow or unstable connection (like 2g). It takes around 15 seconds to finish loading with a 2g connection vs 4 seconds in a good connection (like 4g).
First I tought it was the OTA trying to find updates, but it is still very slow even setting updates.enabled to false.
My test was made using Android

#2

What else are you trying to load before you stop showing the <Apploading /> component? Fonts perhaps? You can bundle those in your app too. Remember you still need to publish your bundle (expo publish) and create a new binary in order for those changes to take effect.

#3

I’m not loading any remote resource (only if expo does it under the hood).
I’m loading 3 fonts from native base:

Roboto: require('native-base/Fonts/Roboto.ttf'),
Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'),
ionicons: require('native-base/Fonts/Ionicons.ttf'),
#4

Yes, expo does strip all your assets out (local fonts, images) and puts them in a cdn unless you instruct it not to do so. I’m not home right now but there’s a section of the docs that is called something like enabling offline access. Check this section in order to find out how to configure your application to bundle those fonts with the binary.

#5

Hey @zaxapp,

Here are the resources Vic was mentioning earlier: https://docs.expo.io/versions/v32.0.0/guides/offline-support/

Cheers,

Adam

#6

Thanks @vic616283 and @adamjnav. I’ll try it later and give a feedback

#7

It doesn’t seems to work. Am I doing it right?

"assetBundlePatterns": [
      "./node_modules/native-base/Fonts/Roboto.ttf",
      "./node_modules/native-base/Fonts/Roboto_medium.ttf",
      "./node_modules/native-base/Fonts/Ionicons.ttf"
    ],

partial console output from expo build:

Processing asset bundle patterns:
- /private/var/www/app/node_modules/native-base/Fonts/Roboto.ttf
- /private/var/www/app/node_modules/native-base/Fonts/Roboto_medium.ttf
- /private/var/www/app/node_modules/native-base/Fonts/Ionicons.ttf
#8

You don’t need the dot slash in the begininng. I would also strongly recommend creating an assets folder in your project root and copying the fonts there.

closed #9

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.