- In
app.json
andInfo.plist
, replace the bundle identifier (com.merkle-manufactory.background-push-demo
) with a unique value. - Run
yarn install
to install dependencies. - Plug in a physical iPhone via USB.
- Run
yarn ios
, and choose the physical device to build the app. - Visit App Store Connect and create a new iOS app with the new bundle ID. Be sure to enable the Push Notification capability.
- Run
yarn ios
to rebuild the app. - Enable push notifications via the app's UI.
- Long-press the device token and copy to clipboard.
- Visit the Apple Push Notification Console, and navigate to the new push notification form.
- Paste the copied device token, and with the app foregrounded, send a normal alert notification.
- Observe
setNotificationHandler#handleNotification
,addNotificationReceivedListener
, andsetNotificationHandler#handleSuccess
in the console logs, indicating that the app is receiving the notification. - Start a new test push form in the Apple Push Notification Console. Paste the device token, and with the app backgrounded, send a background notification (i.e. change the
apns-push-type
tobackground
, which will addcontent-available: 1
to the payload). - Observe
backgroundNotificationTask
in the console logs, indicating that the app is receiving the notification. - Return once more to the Apple Push Notification Console to create a new push notification. Send a background notification to the device, but this time with the app in the foreground.
- Observe that there are no logs from
setNotificationHandler#handleNotification
,addNotificationReceivedListener
,addNotificationResponseReceivedListener
, orbackgroundNotificationTask
.
-
Notifications
You must be signed in to change notification settings - Fork 1
warpcast/background-push-demo
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published