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
+43-29Lines changed: 43 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,9 +173,9 @@ The code for the Push Plugin for NativeScript.
173
173
174
174
or use an existing one.
175
175
176
-
- Add the Push Plugin. This will install the push plugin in node_module, in the root of the project. When adding a new platform (or using an existing one) the plugin will be added there as well.
176
+
- Add the Push Plugin (from NPM). This will install the push plugin in node_module, in the root of the project. When adding a new platform (or using an existing one) the plugin will be added there as well.
177
177
178
-
tns plugin add C:\nativescript-push\push-plugin
178
+
tns plugin add nativescript-push-notifications
179
179
180
180
### Android
181
181
@@ -188,10 +188,10 @@ The code for the Push Plugin for NativeScript.
- Add sample code in main-view-model.js like this one to subscribe and receive messages (Enter your google project id in the options of the register method):
191
+
- Add sample code in app/main-view-model.js in the function HelloWorldModel() like this one to subscribe and receive messages (Enter your google project id in the options of the register method):
192
192
193
193
```javascript
194
-
var pushPlugin =require("push-plugin");
194
+
var pushPlugin =require("nativescript-push-notifications");
195
195
varself=this;
196
196
pushPlugin.register({ senderID:'your-google-project-id' }, function (data){
197
197
self.set("message", ""+JSON.stringify(data));
@@ -206,6 +206,8 @@ The code for the Push Plugin for NativeScript.
206
206
207
207
tns run android
208
208
209
+
- The access token is written in the console and in the message area, after subscribing (Look for ObtainTokenThread log record). When sending a notification, the message below the TAP button should be changed with the message received.
210
+
209
211
### iOS
210
212
211
213
- Edit the package.json file in the root of application, by changing the bundle identifier to match the one from your Push Certificate. For example:
@@ -215,36 +217,34 @@ The code for the Push Plugin for NativeScript.
215
217
216
218
tns platform add ios
217
219
218
-
- Add sample code in main-view-model.js like this one to subscribe and receive messages (Enter your google project id in the options of the register method):
220
+
- Add sample code in app/main-view-model.js in the function HelloWorldModel() like this one to subscribe and receive messages (Enter your google project id in the options of the register method):
219
221
220
222
```javascript
221
223
var pushPlugin =require("nativescript-push-notifications");
0 commit comments