Upgrading
0.2.x → 0.3.0
All additions are backwards compatible. Changes in behaviour you might notice:
-
Android
addPass/addPassJWTnow reject withactivity_errorwhen there is no current Activity,decode_errorwhen the base64 can't be decoded, andpass_errorwhen the payload isn't a JSON object. Before, they silently resolved without showing anything, or launched Google Wallet with a payload it could only reject. -
A second add call while the wallet UI is open now rejects with
presentation_erroron both platforms, instead of stacking another sheet or save flow. -
Android
canAddPasses()no longer returnsfalsebefore the firstonResume. The Google Wallet client is now created lazily. -
Android add-pass result events can report two new error types:
unavailable(API_UNAVAILABLE) andinternal(INTERNAL_ERROR). Before, both were reported asunexpected. If you exhaustivelyswitchoverAddPassResultErrorType, add the two cases. -
The Android button is now Google's "Add to Google Wallet" button, replacing the retired "Save to Google Pay" artwork. Google only allows the black button, in a
primaryorcondensedstyle. The olddark,lightandlight-outlinevariants still work, but they renderprimaryand log a warning in development. The default Android height changed from 44 to 48, to match Google's layout.
New APIs: addPasses, canAddPasses(format), getWalletName, isPassLibraryAvailable, getPasses, getPass, getPassFieldValue, replacePass, removePass, openPass and passLibraryChangedListener.
0.1.x → 0.2.0
The public JavaScript API is unchanged. The only breaking change is the platform baseline: 0.2.0 runs on the New Architecture only.
- Use React Native 0.76 or newer with the New Architecture enabled. It is on by default from 0.76. If you turned it off, turn it back on:
- Android: in
android/gradle.properties, setnewArchEnabled=true. - iOS: run
cd ios && RCT_NEW_ARCH_ENABLED=1 pod install.
- Android: in
- Android: raise
minSdkVersionto at least 24, and build with JDK 17. - iOS: raise the deployment target to 15.1 or higher, then run
pod install. - Remove any manual native linking for this package. The module is autolinked.
- Rebuild from scratch:
yarn add @reeq/react-native-passkit@^0.2.0
cd ios && pod install && cd ..
yarn start --reset-cache
If you imported internal native module names directly (for example NativeModules.PasskitModule), switch to the public exports.