Skip to content

Expo SDK 32 adds initial background location support and interactive notifications

updated

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 .eslintrc rules.
  • Android Contacts: standalone Android apps can now write contacts by adding WRITE_CONTACTS to android.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 paging ScrollViews 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, or import * as Expo from 'expo'; to import everything.
  • expo-font import: import { Font } from 'expo-font'; is deprecated in favor of import * as Font from 'expo-font';.
  • Fingerprint removed: Expo.Fingerprint has been removed; use Expo.LocalAuthentication instead.
  • Font.loadAsync: passing an array to Font.loadAsync is no longer supported.
  • Location: enableHighAccuracy is deprecated in favor of accuracy.
  • Camera: onBarCodeRead is renamed to onBarCodeScanned.
  • Haptic: calling Haptic methods on Android now throws an error instead of logging a warning.

Upgrading

  1. In app.json, set sdkVersion to "32.0.0".
  2. In package.json, set:
    • expo to "^32.0.0"
    • react to "16.5.0"
    • react-native to "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz"
  3. Reinstall node_modules and run expo start -c.

Standalone apps need a new build to pick up the new SDK.

Source: web.archive.org