Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
iOS: Push Notifications not working in Background in Production #264
Browse files Browse the repository at this point in the history
iOS Notification not received in background mode #258
iOS: Push Notifications not working in Background or when application is reopened #243
Notification message not shown when app is in the background #237
  • Loading branch information
EddyVerbruggen committed Jan 20, 2017
1 parent c51e30c commit 29ecf1e
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 4,025 deletions.
14 changes: 12 additions & 2 deletions docs/MESSAGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,28 @@ If you didn't choose this feature during installation you can run the "post inst

#### Enable push support in Xcode

Open your project's target and head over to "Capabilities" to toggle this switch:
Open /platforms/ios/yourproject.__xcworkspace__ (!) and go to your project's target and head over to "Capabilities" to toggle this switch:
<img src="images/push-xcode-config.png" width="600px" alt="Push Xcode config"/>

> Without this enabled you will receive push messages in the foreground, but **NOT in the background** / when the app is killed.
##### copy the entitlements file
The previous step created a the file`platforms/ios/YourAppName/Resources/YourAppName.entitlements`.
Copy that file to `app/App_Resources/iOS/` (if it doesn't exist yet, otherwise merge its contents),
so it's not removed when you remove and re-add the iOS platform. The relevant content for background push in that file is:

```xml
<key>aps-environment</key>
<string>development</string>
```

#### Receiving remote notifications in the background
Open `app/App_Resources/iOS/Info.plist` and add this to the bottom:

```xml
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
<string>remote-notification</string>
</array>
```

Expand Down
250 changes: 112 additions & 138 deletions firebase.ios.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-plugin-firebase",
"version": "3.9.1",
"version": "3.9.2",
"description": "Fire. Base. Firebase!",
"main": "firebase",
"typings": "index.d.ts",
Expand All @@ -11,7 +11,7 @@
}
},
"scripts": {
"bundle-installer": "npm install --ignore-scripts && webpack --config scripts/webpack.config.js scripts/installer.js scripts/postinstall.js && webpack --config scripts/webpack.config.js scripts/install_ios_entitlements.js scripts/install_ios_entitlements_packed.js",
"bundle-installer": "npm install --ignore-scripts && webpack --config scripts/webpack.config.js scripts/installer.js scripts/postinstall.js",
"prepublish": "npm run bundle-installer",
"postinstall": "node scripts/postinstall.js",
"config": "node scripts/postinstall.js config"
Expand Down
60 changes: 0 additions & 60 deletions scripts/install_ios_entitlements.js

This file was deleted.

Loading

0 comments on commit 29ecf1e

Please sign in to comment.