JPushPlugin.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. //
  2. // PushTalkPlugin.h
  3. // PushTalk
  4. //
  5. // Created by zhangqinghe on 13-12-13.
  6. //
  7. //
  8. #import <Cordova/CDV.h>
  9. @interface JPushPlugin : CDVPlugin{
  10. }
  11. //注册通知服务并启动 SDK
  12. -(void)startJPushSDK:(CDVInvokedUrlCommand*)command;
  13. //以下为js中可调用接口
  14. //设置标签、别名
  15. -(void)setTagsWithAlias:(CDVInvokedUrlCommand*)command;
  16. -(void)setTags:(CDVInvokedUrlCommand*)command;
  17. -(void)setAlias:(CDVInvokedUrlCommand*)command;
  18. //获取 RegistrationID
  19. -(void)getRegistrationID:(CDVInvokedUrlCommand*)command;
  20. //页面统计
  21. -(void)startLogPageView:(CDVInvokedUrlCommand*)command;
  22. -(void)stopLogPageView:(CDVInvokedUrlCommand*)command;
  23. -(void)beginLogPageView:(CDVInvokedUrlCommand*)command;
  24. //设置角标到服务器,服务器下一次发消息时,会设置成这个值
  25. //本接口不会改变应用本地的角标值.
  26. -(void)setBadge:(CDVInvokedUrlCommand*)command;
  27. //相当于 [setBadge:0]
  28. -(void)resetBadge:(CDVInvokedUrlCommand*)command;
  29. //应用本地的角标值设置/获取
  30. -(void)setApplicationIconBadgeNumber:(CDVInvokedUrlCommand*)command;
  31. -(void)getApplicationIconBadgeNumber:(CDVInvokedUrlCommand*)command;
  32. //停止与恢复推送
  33. -(void)stopPush:(CDVInvokedUrlCommand*)command;
  34. -(void)resumePush:(CDVInvokedUrlCommand*)command;
  35. -(void)isPushStopped:(CDVInvokedUrlCommand*)command;
  36. //开关日志
  37. -(void)setDebugModeFromIos:(CDVInvokedUrlCommand*)command;
  38. -(void)setLogOFF:(CDVInvokedUrlCommand*)command;
  39. -(void)crashLogON:(CDVInvokedUrlCommand*)command;
  40. //本地推送
  41. -(void)setLocalNotification:(CDVInvokedUrlCommand*)command;
  42. -(void)deleteLocalNotificationWithIdentifierKey:(CDVInvokedUrlCommand*)command;
  43. -(void)clearAllLocalNotifications:(CDVInvokedUrlCommand*)command;
  44. //地理位置上报 [latitude,longitude]
  45. -(void)setLocation:(CDVInvokedUrlCommand*)command;
  46. //检查用户的推送设置情况
  47. -(void)getUserNotificationSettings:(CDVInvokedUrlCommand*)command;
  48. //ios 10 APIs
  49. -(void)addDismissActions:(CDVInvokedUrlCommand*)command;
  50. -(void)addNotificationActions:(CDVInvokedUrlCommand*)command;
  51. /*
  52. * 以下为js中可监听到的事件
  53. * jpush.openNotification 点击推送消息启动或唤醒app
  54. * jpush.setTagsWithAlias 设置标签、别名完成
  55. * jpush.receiveMessage 收到自定义消息
  56. * jpush.receiveNotification 前台收到推送
  57. * jpush.backgroundNotification 后台收到推送
  58. */
  59. # pragma mark - private
  60. +(void)fireDocumentEvent:(NSString*)eventName jsString:(NSString*)jsString;
  61. +(void)setupJPushSDK:(NSDictionary*)userInfo;
  62. @end
  63. JPushPlugin *SharedJPushPlugin;
  64. @interface NSDictionary (JPush)
  65. -(NSString*)toJsonString;
  66. @end
  67. @interface NSString (JPush)
  68. -(NSDictionary*)toDictionary;
  69. @end