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

Commit 3d171c6

Browse files
Not receiving device token #1039
1 parent 2649e6e commit 3d171c6

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

demo-push/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
},
1111
"dependencies": {
12-
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-7.4.2.tgz",
12+
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-7.4.3.tgz",
1313
"nativescript-theme-core": "^1.0.4",
1414
"nativescript-unit-test-runner": "^0.3.4",
1515
"tns-core-modules": "~4.2.0"

docs/NON_FIREBASE_MESSAGING.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,15 @@ so it's not removed when you remove and re-add the iOS platform. The relevant co
4646

4747
> Note that the filename can either be `<YourAppName>.entitlements` or `app.entitlements`, where `YourAppName` is the iOS foldername, see the path above.
4848
49-
#### Allow processing when a background push is received
50-
Open `app/App_Resources/iOS/Info.plist` and add this to the bottom:
49+
#### Configure push notifications in `Info.plist`
50+
Tell the plugin to allow an external push provider by adding this to `App_Resources/iOS/Info.plist` (without this, the push token will always be `undefined`!):
51+
52+
```xml
53+
<key>UseExternalPushProvider</key>
54+
<true/>
55+
```
56+
57+
And to allow processing when a background push is received, add this as well:
5158

5259
```xml
5360
<key>UIBackgroundModes</key>
@@ -56,6 +63,9 @@ Open `app/App_Resources/iOS/Info.plist` and add this to the bottom:
5663
</array>
5764
```
5865

66+
The end result should look like [this](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/58d2792421be0d9c3d8fbdddd4abd6c782b30723/demo-push/app_resources/iOS/Info.plist#L46-L51).
67+
68+
####
5969
## API
6070

6171
### `areNotificationsEnabled`

src/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"demo-ng.ios.bundled": "npm run preparedemo-ng && cd ../demo-ng && tns run ios --bundle",
4545
"demo-push.ios": "npm run preparedemo-push && cd ../demo-push && tns run ios",
4646
"demo-push.ios.release": "npm run preparedemo-push && cd ../demo-push && tns build ios --release --for-device",
47+
"demo-push.ios.eddy.iphoneX": "npm run preparedemo-push && cd ../demo-push && tns run ios --device a4cbb499e279054b55c206528f8510ff7fbf20c8",
4748
"demo.android": "npm run preparedemo && cd ../demo && rimraf platforms/android && tns run android",
4849
"demo.android.linked": "npm run tsc && cd ../demo && tns run android --syncAllFiles",
4950
"demo-ng.android": "npm run preparedemo-ng && cd ../demo-ng && tns run android",
@@ -62,6 +63,8 @@
6263
"tslint.demo": "tslint --config '../tslint.json' '../demo/app/*.ts' --exclude '**/node_modules/**'",
6364
"ci.tslint": "npm run tslint && npm run tslint.demo",
6465
"development.setup": "npm run setup && npm link && cd ../demo && npm link nativescript-plugin-firebase && cd ../src",
66+
"android.list-devices": "tns device android --available-devices",
67+
"ios.list-devices": "tns device ios --available-devices",
6568
"generate.typings.ios": "cd ../demo-ng && TNS_DEBUG_METADATA_PATH=\"$(pwd)/metadata\" tns build ios && TNS_TYPESCRIPT_DECLARATIONS_PATH=\"$(pwd)/typings\" tns build ios && echo 'Now look for your library typings in demo-ng/typings!'",
6669
"generate.typings.android": "echo '##### Download the latest relevant .aar file from https://mvnrepository.com/artifact/com.google.firebase, rename .aar to .zip and extract it. Then move classes.jar to the plugin /src folder' && java -jar ../../android-dts-generator/dts-generator/build/libs/dts-generator.jar -input ./classes.jar -output platforms/android/typings/$npm_package_config_typings && rimraf classes.jar && echo '##### Done! Deleted src/classes.jar, and generated typings in src/platforms/android/typings/'",
6770
"generate.typings.android.analytics": "npm run generate.typings.android --nativescript-plugin-firebase:typings=analytics-impl",

0 commit comments

Comments
 (0)