Skip to content
This repository was archived by the owner on Feb 7, 2019. It is now read-only.

Commit 6971682

Browse files
authored
Merge pull request #176 from NativeScript/zbranzov/doc-changes
add more steps to the docs
2 parents 84aa277 + abf8e44 commit 6971682

File tree

1 file changed

+32
-7
lines changed

1 file changed

+32
-7
lines changed

README.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ In the Command prompt / Terminal navigate to your application root folder and ru
2323

2424
> 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.
2525
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:
32+
```
33+
android {
34+
...
35+
defaultConfig {
36+
applicationId = "org.NativeScript.PushNotificationApp"
37+
}
38+
...
39+
}
40+
```
41+
2642
- Go to the application folder and add the Android platform to the application
2743
2844
tns platform add android
@@ -40,24 +56,33 @@ The plugin will default to version 11.4.2 of the `firebase-messaging` SDK. If y
4056

4157
### iOS
4258

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.
4460

4561
- Edit the package.json file in the root of application, by changing the bundle identifier to match the App ID. For example:
4662
```
4763
"id": "org.NativeScript.PushNotificationApp"
4864
```
4965
5066
- Go to the application folder and add the iOS platform to the application
67+
```
68+
tns build ios
69+
```
5170
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+
```
5681
5782
## Usage
5883
### Android
5984
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):
6186
6287
*TypeScript*
6388
```TypeScript
@@ -93,7 +118,7 @@ Add code in your view model or compoent to subscribe and receive messages (don't
93118

94119
### iOS
95120

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:
97122

98123
*TypeScript*
99124
```TypeScript

0 commit comments

Comments
 (0)