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

Commit 4131c4f

Browse files
committed
Update README.md
1 parent b6ae937 commit 4131c4f

1 file changed

Lines changed: 42 additions & 41 deletions

File tree

README.md

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -221,47 +221,48 @@ The code for the Push Plugin for NativeScript.
221221

222222
```javascript
223223
var pushPlugin = require("nativescript-push-notifications");
224-
var self = this;
225-
var iosSettings = {
226-
badge: true,
227-
sound: true,
228-
alert: true,
229-
interactiveSettings: {
230-
actions: [{
231-
identifier: 'READ_IDENTIFIER',
232-
title: 'Read',
233-
activationMode: "foreground",
234-
destructive: false,
235-
authenticationRequired: true
236-
}, {
237-
identifier: 'CANCEL_IDENTIFIER',
238-
title: 'Cancel',
239-
activationMode: "foreground",
240-
destructive: true,
241-
authenticationRequired: true
242-
}],
243-
categories: [{
244-
identifier: 'READ_CATEGORY',
245-
actionsForDefaultContext: ['READ_IDENTIFIER', 'CANCEL_IDENTIFIER'],
246-
actionsForMinimalContext: ['READ_IDENTIFIER', 'CANCEL_IDENTIFIER']
247-
}]
248-
},
249-
notificationCallbackIOS: function (data) {
250-
self.set("message", "" + JSON.stringify(data));
251-
}
252-
};
253-
254-
pushPlugin.register(iosSettings, function (data) {
255-
self.set("message", "" + JSON.stringify(data));
256-
257-
// Register the interactive settings
258-
if(settings.interactiveSettings) {
259-
pushPlugin.registerUserNotificationSettings(function() {
260-
alert('Successfully registered for interactive push.');
261-
}, function(err) {
262-
alert('Error registering for interactive push: ' + JSON.stringify(err));
263-
});
264-
}, function() { });
224+
var self = this;
225+
var iosSettings = {
226+
badge: true,
227+
sound: true,
228+
alert: true,
229+
interactiveSettings: {
230+
actions: [{
231+
identifier: 'READ_IDENTIFIER',
232+
title: 'Read',
233+
activationMode: "foreground",
234+
destructive: false,
235+
authenticationRequired: true
236+
}, {
237+
identifier: 'CANCEL_IDENTIFIER',
238+
title: 'Cancel',
239+
activationMode: "foreground",
240+
destructive: true,
241+
authenticationRequired: true
242+
}],
243+
categories: [{
244+
identifier: 'READ_CATEGORY',
245+
actionsForDefaultContext: ['READ_IDENTIFIER', 'CANCEL_IDENTIFIER'],
246+
actionsForMinimalContext: ['READ_IDENTIFIER', 'CANCEL_IDENTIFIER']
247+
}]
248+
},
249+
notificationCallbackIOS: function (data) {
250+
self.set("message", "" + JSON.stringify(data));
251+
}
252+
};
253+
254+
pushPlugin.register(iosSettings, function (data) {
255+
self.set("message", "" + JSON.stringify(data));
256+
257+
// Register the interactive settings
258+
if(iosSettings.interactiveSettings) {
259+
pushPlugin.registerUserNotificationSettings(function() {
260+
alert('Successfully registered for interactive push.');
261+
}, function(err) {
262+
alert('Error registering for interactive push: ' + JSON.stringify(err));
263+
});
264+
}
265+
}, function() { });
265266
```
266267

267268
- Run the code

0 commit comments

Comments
 (0)