$rest.on({
method: $.net.http.POST,
path: "/registerDevice",
produces: "application/json",
handler: $util.restOnHandlerHDB($pushService.registerDevice),
errorhandler: $errorlog.errorhandler
});
{
"deviceToken": "9F474D755EBB4E46B689859F0523449E",
"userId": "XXX",
"language": "zh",
"timeZoneOffset": -480,
"targetType": "aps",
"deviceid": "abcdefg",
"deviceType": " iphopne11",
"appId": "com.xxx.xxxxxxx"
}
$rest.on({
method: $.net.http.POST,
path: "/unregisterDevice",
produces: "application/json",
handler: $util.restOnHandlerHDB($pushService.unregisterDevice),
errorhandler: $errorlog.errorhandler
});
{
"deviceToken": "9F474D755EBB4E46B689859F0523449E"
}
$rest.on({
method: $.net.http.POST,
path: "/updateDeviceLanguage",
produces: "application/json",
handler: $util.restOnHandlerHDB($pushService.updateDeviceLanguage),
errorhandler: $errorlog.errorhandler
});
{
"deviceToken": "9F474D755EBB4E46B689859F0523449E",
" language ": "en"
}
$rest.on({
method: $.net.http.POST,
path: "/createNotification",
produces: "application/json",
handler: $util.restOnHandlerHDB($pushService.createNotification),
errorhandler: $errorlog.errorhandler
});
{
"aNotification": [
{
"NOTIFICATION_ID": "9595FC5DCE80AC39E200BC68E2623BE1",
"RECEIVER_USER_ID": "GUCHAO",
"REFERENCE_TYPE": "TRAINING",
"REFERENCE_ID": "1263F891857A8742A59891A9A26B65D2",
"TEAM_ID": "9D612DB59EA63C46AF8664E6FA88BE18",
"USER_PERSON_ID": "9FE3E121A9ECE04DB194672AF58D479A",
"OPERATION_TYPE": "DELETE",
"DATETIME_PARAMETER1": "2019-12-22 05:40:54.0710000",
"SCENARIO": 1,
"PUSH_STATUS": "UNPUSH",
"READ_STATUS": "UNREAD"
}
],
"aNotificationMessages": [
{
"NOTIFICATION_ID": "9595FC5DCE80AC39E200BC68E2623BE1",
"LANGUAGE": "en",
"TITLE": "test title en 1",
"MESSAGE": "test message en 1 at {0}"
}
]
}
$rest.on({
method: $.net.http.GET,
path: "/getNotificationList",
produces: "application/json",
handler: $util.restOnHandlerHDB($pushService.getNotificationList),
errorhandler: $errorlog.errorhandler
});
[
{
"notificationId": "55EBB4E46B689859F0523449E",
"language": "zh",
"title": "test title",
"message": "test message test message",
"referenceType": "TRAINING",
"referenceId": "6B689859F0523449E",
"operationType": "DELETE",
"messageSendDateTime": "2019-12-26T12:00:00:000Z",
"teamId": "XXEBB4E46B689859F052ABCDH ",
"userId": "FRANKLIN",
"userPersonId": "9FE3E121A9ECE04DB194672AF58D479A",
"status": 0
}
]
$rest.on({
method: $.net.http.GET,
path: "/getUnreadNotificationCount",
produces: "application/json",
handler: $util.restOnHandlerHDB($pushService.getUnreadNotificationCount),
errorhandler: $errorlog.errorhandler
});
{
"haveUnreadNotification": true,
"unreadNotificationCount": 20
}
$rest.on({
method: $.net.http.POST,
path: "/updateNotificationList2Read",
produces: "application/json",
handler: $util.restOnHandlerHDB($pushService.updateNotificationList2Read),
errorhandler: $errorlog.errorhandler
});
[
{
"notificationId": "9595FC5DCE80AC39E200BC68E2623BE1"
},
{
"notificationId": "9595FC5DCE80AC39E200BC68E2623BE2"
}
]
$rest.on({
method: $.net.http.POST,
path: "/deleteNotificationList",
produces: "application/json",
handler: $util.restOnHandlerHDB($pushService.deleteNotificationList),
errorhandler: $errorlog.errorhandler
});
[
{
"notificationId": "9595FC5DCE80AC39E200BC68E2623BE1"
},
{
"notificationId": "9595FC5DCE80AC39E200BC68E2623BE2"
}
]
// Required to register for notifications
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
//remote notification
[RCTPushNotificationManager didRegisterUserNotificationSettings:notificationSettings];
}
// Required for the registrationError event.
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
NSLog(@"Registfail,Register failed reason%@",error);
[RCTPushNotificationManager didFailToRegisterForRemoteNotificationsWithError:error];
}
// Required for the register event.
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
[RCTPushNotificationManager didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
// Required for the notification event. You must call the completion handler after handling the remote notification.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
NSLog(@"%@", userInfo);
[RCTPushNotificationManager didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |