Expo SDK 32 adds initial background location support and interactive notifications
Expo has released SDK v32.0.0. Like SDK 31, it is built on React Native 0.57. It is the second release in Expo's "Expo for Professionals" push, geared towards better supporting professionals who use Expo as part of a business.
Background location and geofencing
SDK 32 adds initial support for background location, a highly requested feature. Apps can define JavaScript tasks that receive location updates in the background. They can also register geofencing tasks that fire when the device enters or leaves a geographic region. Both features use the new TaskManager module, which runs defined tasks periodically. If the app is not running when an event fires, it is started in the background so the task can execute. Expo says to expect the background location API and its behavior to change in future releases, and recommends treating it as if it were part of DangerZone.
On iOS only, a new background fetch module also uses TaskManager to schedule periodic network requests.
Interactive notifications
SDK 32 supports notification categories and actions. Users can respond to a notification without opening the app. Actions appear as buttons and can prompt for text, and all input is passed back to the app.
SMS permission removed
To comply with Google's policy on SMS and Call Log permissions, the SMS module no longer uses the Android READ_SMS permission. Permissions.SMS has been removed. On Android, SMS.sendSMSAsync now resolves to { result: 'unknown' }. Expo recommends that apps using the SMS module upgrade soon.
Other changes
- SDK support: SDK 25 is no longer supported in the latest Expo Client, and SDK 26 will be dropped in the next release. Existing standalone apps built with SDK 25 keep working.
- Snack: Snack gains save history for signed-in users, TypeScript support and custom
.eslintrcrules. - Android Contacts: standalone Android apps can now write contacts by adding
WRITE_CONTACTStoandroid.permissions. This does not work in Expo Client. - ExpoKit: bundle download progress now shows in development mode.
- Fixes: on Android, inverted
ScrollViews fling in the right direction and pagingScrollViews snap correctly, and Android standalone apps are smaller. - Library updates: react-native-gesture-handler 1.0.12, react-native-reanimated 1.0.0-alpha.11, react-native-screens 1.0.0-alpha.19, react-native-maps 0.22.1 and react-native-svg 8.0.10.
Breaking changes
- Default export removed:
import Expo from 'expo';no longer works. Use named imports, orimport * as Expo from 'expo';to import everything. - expo-font import:
import { Font } from 'expo-font';is deprecated in favor ofimport * as Font from 'expo-font';. - Fingerprint removed:
Expo.Fingerprinthas been removed; useExpo.LocalAuthenticationinstead. - Font.loadAsync: passing an array to
Font.loadAsyncis no longer supported. - Location:
enableHighAccuracyis deprecated in favor ofaccuracy. - Camera:
onBarCodeReadis renamed toonBarCodeScanned. - Haptic: calling Haptic methods on Android now throws an error instead of logging a warning.
Upgrading
- In
app.json, setsdkVersionto"32.0.0". - In
package.json, set:expoto"^32.0.0"reactto"16.5.0"react-nativeto"https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz"
- Reinstall
node_modulesand runexpo start -c.
Standalone apps need a new build to pick up the new SDK.
Links
Source: web.archive.org