You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 7, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+32-7Lines changed: 32 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,22 @@ In the Command prompt / Terminal navigate to your application root folder and ru
23
23
24
24
> See the [Android Configuration for using Firebase Cloud Messaging](#android-configuration-for-using-firebase-cloud-messaging) for information about how to add Firebase to your project.
25
25
26
+
- Edit the `package.json` file in the root of application, by changing the bundle identifier to match the Firebase's project package name. For example:
27
+
```
28
+
"id": "org.NativeScript.PushNotificationApp"
29
+
```
30
+
31
+
- Edit the `app/App_Resources/Android/app.gradle` file of your application, by changing the application ID to match the bundle identifier from the package.json. For example:
- Go to the application folder and add the Android platform to the application
27
43
28
44
tns platform add android
@@ -40,24 +56,33 @@ The plugin will default to version 11.4.2 of the `firebase-messaging` SDK. If y
40
56
41
57
### iOS
42
58
43
-
- Ensure you have set up an App in your Apple Developer account, with Push Notifications enabled and configured. More on this in the Apple's [AddingCapabilities documentation](https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html)
59
+
- Ensure you have set up an App in your Apple Developer account, with Push Notifications enabled and configured. More on this in the Apple's [AddingCapabilities documentation](https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html) > `Configuring Push Notifications` section.
44
60
45
61
- Edit the package.json file in the root of application, by changing the bundle identifier to match the App ID. For example:
46
62
```
47
63
"id": "org.NativeScript.PushNotificationApp"
48
64
```
49
65
50
66
- Go to the application folder and add the iOS platform to the application
67
+
```
68
+
tns build ios
69
+
```
51
70
52
-
tns platform add ios
53
-
54
-
- Go to (application folder)/platforms/ios and open the XCode project. Enable Push Notifications in the project Capabilities options.
55
-
71
+
- Go to (application folder)/platforms/ios and open the XCode project. Enable Push Notifications in the project Capabilities options. In case you don't have XCode,
72
+
go to (application folder)/platforms/ios/(application folder name) , find *.entitlements file and add to it `aps-environment` key and its value as shown below:
73
+
```
74
+
<plist version="1.0">
75
+
<dict>
76
+
<key>aps-environment</key>
77
+
<string>development</string>
78
+
</dict>
79
+
</plist>
80
+
```
56
81
57
82
## Usage
58
83
### Android
59
84
60
-
Add code in your view model or compoent to subscribe and receive messages (don't forget to enter your Firebase Cloud Messaging **Sender ID** in the options of the register method):
85
+
Add code in your view model or component to subscribe and receive messages (don't forget to enter your Firebase Cloud Messaging **Sender ID** in the options of the register method):
61
86
62
87
*TypeScript*
63
88
```TypeScript
@@ -93,7 +118,7 @@ Add code in your view model or compoent to subscribe and receive messages (don't
93
118
94
119
### iOS
95
120
96
-
Add code in your view model or compoent to subscribe and receive messages:
121
+
Add code in your view model or component to subscribe and receive messages:
0 commit comments