diff --git a/package.json b/package.json index 8ec66fd..16b1b41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jpush-phonegap-plugin", - "version": "3.7.6", + "version": "3.8.0", "description": "JPush for cordova plugin", "cordova": { "id": "jpush-phonegap-plugin", @@ -23,7 +23,7 @@ ], "devDependencies": { "cordova-plugin-device": "*", - "cordova-plugin-jcore": ">=1.3.0" + "cordova-plugin-jcore": ">=1.4.0" }, "author": "JiGuang", "license": "MIT", diff --git a/plugin.xml b/plugin.xml index 7bd5c61..2f71fe3 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="3.8.0"> JPush JPush for cordova plugin @@ -49,7 +49,7 @@ - + @@ -64,6 +64,7 @@ + $APP_KEY @@ -105,6 +106,7 @@ + @@ -204,7 +206,8 @@ - + @@ -227,7 +230,8 @@ + android:process=":pushcore" + android:exported="false"> @@ -255,7 +259,7 @@ - + @@ -266,11 +270,16 @@ target="res/drawable/jpush_richpush_btn_selector.xml" /> - + + + @@ -278,8 +287,19 @@ target="res/layout/jpush_webview_layout.xml" /> + + + + + + diff --git a/src/android/libs/jpush-android-3.6.6.jar b/src/android/libs/jpush-android-3.6.6.jar deleted file mode 100755 index a43ba9c..0000000 Binary files a/src/android/libs/jpush-android-3.6.6.jar and /dev/null differ diff --git a/src/android/libs/jpush-android-4.1.0.jar b/src/android/libs/jpush-android-4.1.0.jar new file mode 100644 index 0000000..75544b7 Binary files /dev/null and b/src/android/libs/jpush-android-4.1.0.jar differ diff --git a/src/android/res/drawable-hdpi/jpush_ic_action_cancle.png b/src/android/res/drawable-hdpi/jpush_ic_action_cancle.png new file mode 100644 index 0000000..473abfe Binary files /dev/null and b/src/android/res/drawable-hdpi/jpush_ic_action_cancle.png differ diff --git a/src/android/res/drawable-hdpi/jpush_ic_action_close.png b/src/android/res/drawable-hdpi/jpush_ic_action_close.png new file mode 100644 index 0000000..4c6e670 Binary files /dev/null and b/src/android/res/drawable-hdpi/jpush_ic_action_close.png differ diff --git a/src/android/res/drawable-hdpi/jpush_ic_action_close2.png b/src/android/res/drawable-hdpi/jpush_ic_action_close2.png new file mode 100644 index 0000000..bcedf3c Binary files /dev/null and b/src/android/res/drawable-hdpi/jpush_ic_action_close2.png differ diff --git a/src/android/res/drawable-hdpi/jpush_ic_richpush_actionbar_back.png b/src/android/res/drawable-hdpi/jpush_ic_richpush_actionbar_back.png old mode 100755 new mode 100644 diff --git a/src/android/res/drawable-hdpi/jpush_ic_richpush_actionbar_divider.png b/src/android/res/drawable-hdpi/jpush_ic_richpush_actionbar_divider.png old mode 100755 new mode 100644 diff --git a/src/android/res/drawable-hdpi/jpush_richpush_btn_selector.xml b/src/android/res/drawable-hdpi/jpush_richpush_btn_selector.xml old mode 100755 new mode 100644 diff --git a/src/android/res/drawable-hdpi/jpush_richpush_progressbar.xml b/src/android/res/drawable-hdpi/jpush_richpush_progressbar.xml old mode 100755 new mode 100644 diff --git a/src/android/res/layout-v21/push_notification.xml b/src/android/res/layout-v21/push_notification.xml old mode 100755 new mode 100644 index b9fb2aa..630ab7b --- a/src/android/res/layout-v21/push_notification.xml +++ b/src/android/res/layout-v21/push_notification.xml @@ -3,21 +3,21 @@ android:id="@+id/push_root_view" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingTop="2dp" - android:paddingRight="8dp" - android:paddingLeft="8dp" - android:paddingBottom="4dp"> + android:layout_height="wrap_content"> + - + android:layout_height="wrap_content" + android:visibility="gone"> + android:textStyle="bold" + android:text="·" + android:textSize="16sp" /> + + + + + + + - - - - - - - + android:layout_height="wrap_content" + android:id="@+id/push_notification_layout_time" + android:gravity="center_vertical" + android:weightSum="1" + android:orientation="horizontal"> - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/android/res/layout-v21/push_notification_large.xml b/src/android/res/layout-v21/push_notification_large.xml new file mode 100644 index 0000000..a779f1f --- /dev/null +++ b/src/android/res/layout-v21/push_notification_large.xml @@ -0,0 +1,298 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/android/res/layout-v21/push_notification_middle.xml b/src/android/res/layout-v21/push_notification_middle.xml new file mode 100644 index 0000000..e856534 --- /dev/null +++ b/src/android/res/layout-v21/push_notification_middle.xml @@ -0,0 +1,298 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/android/res/layout/jpush_inapp_banner.xml b/src/android/res/layout/jpush_inapp_banner.xml new file mode 100644 index 0000000..a2f16df --- /dev/null +++ b/src/android/res/layout/jpush_inapp_banner.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/android/res/layout/jpush_popwin_layout.xml b/src/android/res/layout/jpush_popwin_layout.xml old mode 100755 new mode 100644 diff --git a/src/android/res/layout/jpush_webview_layout.xml b/src/android/res/layout/jpush_webview_layout.xml old mode 100755 new mode 100644 diff --git a/src/android/res/layout/push_notification.xml b/src/android/res/layout/push_notification.xml old mode 100755 new mode 100644 index 611e3ae..1642235 --- a/src/android/res/layout/push_notification.xml +++ b/src/android/res/layout/push_notification.xml @@ -3,21 +3,21 @@ android:id="@+id/push_root_view" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingTop="2dp" - android:paddingRight="8dp" - android:paddingLeft="8dp" - android:paddingBottom="4dp"> + android:layout_height="wrap_content"> + - + android:layout_height="wrap_content" + android:visibility="gone"> + android:textStyle="bold" + android:text="·" + android:textSize="16sp" /> + + + + + + + - - - - - - + android:layout_height="wrap_content" + android:id="@+id/push_notification_layout_time" + android:gravity="center_vertical" + android:orientation="horizontal"> - - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/android/res/layout/push_notification_large.xml b/src/android/res/layout/push_notification_large.xml new file mode 100644 index 0000000..c93a22c --- /dev/null +++ b/src/android/res/layout/push_notification_large.xml @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/android/res/layout/push_notification_middle.xml b/src/android/res/layout/push_notification_middle.xml new file mode 100644 index 0000000..2ca2deb --- /dev/null +++ b/src/android/res/layout/push_notification_middle.xml @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/android/res/values-zh/jpush_string.xml b/src/android/res/values-zh/jpush_string.xml old mode 100755 new mode 100644 diff --git a/src/android/res/values/jpush_string.xml b/src/android/res/values/jpush_string.xml old mode 100755 new mode 100644 diff --git a/src/android/res/values/jpush_style.xml b/src/android/res/values/jpush_style.xml old mode 100755 new mode 100644 diff --git a/src/ios/lib/JPUSHService.h b/src/ios/lib/JPUSHService.h index 36ce5b6..2e86a75 100755 --- a/src/ios/lib/JPUSHService.h +++ b/src/ios/lib/JPUSHService.h @@ -9,7 +9,7 @@ * Copyright (c) 2011 ~ 2017 Shenzhen HXHG. All rights reserved. */ -#define JPUSH_VERSION_NUMBER 3.3.3 +#define JPUSH_VERSION_NUMBER 3.5.2 #import @@ -22,10 +22,12 @@ @class UNNotification; @protocol JPUSHRegisterDelegate; @protocol JPUSHGeofenceDelegate; +@protocol JPushInMessageDelegate; typedef void (^JPUSHTagsOperationCompletion)(NSInteger iResCode, NSSet *iTags, NSInteger seq); typedef void (^JPUSHTagValidOperationCompletion)(NSInteger iResCode, NSSet *iTags, NSInteger seq, BOOL isBind); typedef void (^JPUSHAliasOperationCompletion)(NSInteger iResCode, NSString *iAlias, NSInteger seq); +typedef void (^JPUSHInMssageCompletion)(NSInteger iResCode); extern NSString *const kJPFNetworkIsConnectingNotification; // 正在连接中 extern NSString *const kJPFNetworkDidSetupNotification; // 建立连接 @@ -55,6 +57,17 @@ typedef NS_ENUM(NSUInteger, JPAuthorizationStatus) { JPAuthorizationStatusProvisional NS_AVAILABLE_IOS(12.0), // The application is authorized to post non-interruptive user notifications. }; +typedef NS_ENUM(NSInteger,JPushInMessageContentType){ + JPushAdContentType = 1, //广告类型的inMessage + JPushNotiContentType = 2, //通知类型的inMessage +}; + +typedef NS_OPTIONS(NSUInteger, JPInMessageType) { + JPInMessageTypeBanner = (1 << 0), // 横幅 + JPInMessageTypeModal = (1 << 1), // 模态 + JPInMessageTypeFloat = (1 << 2), // 小浮窗 +}; + /*! * 通知注册实体类 */ @@ -641,6 +654,45 @@ typedef NS_ENUM(NSUInteger, JPAuthorizationStatus) { */ + (void)setLocationEanable:(BOOL)isEanble; +/*! +* @abstract 设置应用内消息的代理 +* +* @discussion 遵守JPushInMessageDelegate的代理对象 +* +*/ ++ (void)setInMessageDelegate:(id)inMessageDelegate; + + +/*! +* @abstract 主动拉取应用内消息的接口 +* +* @discussion 拉取结果的回调 +* +*/ ++ (void)pullInMessageCompletion:(JPUSHInMssageCompletion)completion; + + +/*! +* @abstract 主动拉取应用内消息的接口 +* +* @param types 应用内消息样式 +* +* @discussion 拉取结果的回调 +*/ ++ (void)pullInMessageWithTypes:(NSUInteger)types completion:(JPUSHInMssageCompletion)completion; + + +/*! +* @abstract 向sdk报告当前展示的控制器的名称 +* +* @param className 当前页面的类名 +* +* @discussion 如果类名在黑名单内,就会关闭所有处于曝光状态的inapp +* +*/ ++ (void)currentViewControllerName:(NSString *)className; + + ///---------------------------------------------------- ///********************下列方法已过期******************** ///**************请使用新版tag/alias操作接口************** @@ -733,3 +785,42 @@ callbackSelector:(SEL)cbSelector - (void)jpushGeofenceIdentifer:(NSString *)geofenceId didExitRegion:(NSDictionary *)userInfo error:(NSError *)error; @end + +@protocol JPushInMessageDelegate + +@optional +/** + *是否允许应用内消息弹出,默认为允许 +*/ +- (BOOL)jPushInMessageIsAllowedInMessagePop; + +/** + *应用内消息展示的回调 +*/ +- (void)jPushInMessageAlreadyPop __attribute__((deprecated("JPush 3.4.0 版本已过期")));; + +/** + *应用内消息已消失 +*/ +- (void)jPushInMessageAlreadyDisappear; + + +/** + inMessage展示的回调 + + @param messageType inMessage + @param content 下发的数据,广告类的返回数据为空时返回的信息 + + */ +- (void)jPushInMessageAlreadyPopInMessageType:(JPushInMessageContentType)messageType Content:(NSDictionary *)content; + +/** + inMessage点击的回调 + + @param messageType inMessage + @param content 下发的数据,广告类的返回数据为空时返回的信息 + + */ +- (void)jpushInMessagedidClickInMessageType:(JPushInMessageContentType)messageType Content:(NSDictionary *)content; + +@end diff --git a/src/ios/lib/jpush-ios-3.3.3.a b/src/ios/lib/jpush-ios-3.3.3.a deleted file mode 100755 index b7c837d..0000000 Binary files a/src/ios/lib/jpush-ios-3.3.3.a and /dev/null differ diff --git a/src/ios/lib/jpush-ios-3.5.2.a b/src/ios/lib/jpush-ios-3.5.2.a new file mode 100755 index 0000000..67db1e1 Binary files /dev/null and b/src/ios/lib/jpush-ios-3.5.2.a differ