Skip to content

Commit

Permalink
update SDK
Browse files Browse the repository at this point in the history
1. iOS 3.0.2
2. Android 3.0.1
  • Loading branch information
pikacode committed Mar 13, 2017
1 parent a8b79ca commit 1ef65d5
Show file tree
Hide file tree
Showing 21 changed files with 64 additions and 58 deletions.
Binary file added Plugins/Android/libs/arm64-v8a/libjcore110.so
Binary file not shown.
Binary file removed Plugins/Android/libs/arm64-v8a/libjpush219.so
Binary file not shown.
Binary file added Plugins/Android/libs/armeabi-v7a/libjcore110.so
Binary file not shown.
Binary file removed Plugins/Android/libs/armeabi-v7a/libjpush219.so
Binary file not shown.
Binary file added Plugins/Android/libs/armeabi/libjcore110.so
Binary file not shown.
Binary file removed Plugins/Android/libs/armeabi/libjpush219.so
Binary file not shown.
Binary file added Plugins/Android/libs/jcore-android_v1.1.0.jar
Binary file not shown.
Binary file removed Plugins/Android/libs/jpush-android-2.1.9.jar
Binary file not shown.
Binary file added Plugins/Android/libs/jpush-android_v3.0.1.jar
Binary file not shown.
Binary file added Plugins/Android/libs/mips/libjcore110.so
Binary file not shown.
Binary file removed Plugins/Android/libs/mips/libjpush219.so
Binary file not shown.
Binary file added Plugins/Android/libs/mips64/libjcore110.so
Binary file not shown.
Binary file removed Plugins/Android/libs/mips64/libjpush219.so
Binary file not shown.
Binary file added Plugins/Android/libs/x86/libjcore110.so
Binary file not shown.
Binary file removed Plugins/Android/libs/x86/libjpush219.so
Binary file not shown.
Binary file added Plugins/Android/libs/x86_64/libjcore110.so
Binary file not shown.
Binary file removed Plugins/Android/libs/x86_64/libjpush219.so
Binary file not shown.
16 changes: 11 additions & 5 deletions Plugins/iOS/JPUSHService.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* | | | | / /\ \ | | | | \ \______| |
* | | | | /_/ \_\ | | | | \_________|
*
* Copyright (c) 2011 ~ 2015 Shenzhen HXHG. All rights reserved.
* Copyright (c) 2011 ~ 2017 Shenzhen HXHG. All rights reserved.
*/

#define JPUSH_VERSION_NUMBER 2.2.0
#define JPUSH_VERSION_NUMBER 3.0.2

#import <Foundation/Foundation.h>

Expand All @@ -31,6 +31,13 @@ extern NSString *const kJPFNetworkDidLoginNotification; // 登录成功
extern NSString *const kJPFNetworkDidReceiveMessageNotification; // 收到消息(非APNS)
extern NSString *const kJPFServiceErrorNotification; // 错误提示

typedef NS_OPTIONS(NSUInteger, JPAuthorizationOptions) {
JPAuthorizationOptionNone = 0, // the application may not present any UI upon a notification being received
JPAuthorizationOptionBadge = (1 << 0), // the application may badge its icon upon a notification being received
JPAuthorizationOptionSound = (1 << 1), // the application may play a sound upon a notification being received
JPAuthorizationOptionAlert = (1 << 2), // the application may display an alert upon a notification being received
};

/*!
* 通知注册实体类
*/
Expand Down Expand Up @@ -186,7 +193,7 @@ extern NSString *const kJPFServiceErrorNotification; // 错误提示

/*!
* 下面的接口是可选的
* 设置标签和(或)别名(若参数为nil,则忽略;若是空对象,则清空;详情请参考文档:http://docs.jiguang.cn/client/ios_api/#api-ios
* 设置标签和(或)别名(若参数为nil,则忽略;若是空对象,则清空;详情请参考文档:https://docs.jiguang.cn/jpush/client/iOS/ios_api/)
* setTags:alias:fetchCompletionHandle:是新的设置标签别名的方法,不再需要显示声明回调函数,只需要在block里面处理设置结果即可.
* WARN: 使用block时需要注意循环引用问题
*/
Expand Down Expand Up @@ -243,7 +250,7 @@ callbackSelector:(SEL)cbSelector
+ (void)stopLogPageView:(NSString *)pageName;

/*!
* @abstract 直接上报在页面的停留时工
* @abstract 直接上报在页面的停留时间
*
* @param pageName 页面
* @param seconds 停留的秒数
Expand Down Expand Up @@ -364,7 +371,6 @@ callbackSelector:(SEL)cbSelector
* @abstract 删除本地推送定义
*
* @param notificationKey 本地推送标示符
* @param myUILocalNotification 本地推送对象
* @discussion 此方法被[removeNotification:]方法取代
*/
+ (void)deleteLocalNotificationWithIdentifierKey:(NSString *)notificationKey __attribute__((deprecated("JPush 2.1.9 版本已过期")));
Expand Down
Binary file not shown.
Binary file added Plugins/iOS/jpush-ios-3.0.2.a
Binary file not shown.
106 changes: 53 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# JPush Unity Plugin

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jpush/jpush-unity3d-plugin)
[![release](https://img.shields.io/badge/release-2.1.0-blue.svg)](https://github.com/jpush/jpush-unity3d-plugin/releases)
[![release](https://img.shields.io/badge/release-3.0.0-blue.svg)](https://github.com/jpush/jpush-unity3d-plugin/releases)
[![platforms](https://img.shields.io/badge/platforms-iOS%7CAndroid-lightgrey.svg)](https://github.com/jpush/jpush-unity3d-plugin)
[![weibo](https://img.shields.io/badge/weibo-JPush-blue.svg)](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)

Expand Down Expand Up @@ -38,7 +38,7 @@

#import "JPUSHService.h"
#import <UserNotifications/UserNotifications.h>

// 如需使用广告标识符 IDFA 则添加该头文件,否则不添加。
#import <AdSupport/AdSupport.h>

Expand All @@ -47,26 +47,26 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) {
#ifdef NSFoundationVersionNumber_iOS_9_x_Max
JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init];
entity.types = UNAuthorizationOptionAlert | UNAuthorizationOptionBadge | UNAuthorizationOptionSound;
[JPUSHService registerForRemoteNotificationConfig:entity delegate:self];
#endif
}

#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) {
#ifdef NSFoundationVersionNumber_iOS_9_x_Max
JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init];
entity.types = UNAuthorizationOptionAlert | UNAuthorizationOptionBadge | UNAuthorizationOptionSound;
[JPUSHService registerForRemoteNotificationConfig:entity delegate:self];
#endif
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
//可以添加自定义categories
[JPUSHService registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:nil];
} else {
//categories 必须为nil
[JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert) categories:nil];
}
#else
//categories 必须为nil
[JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert) categories:nil];
#endif
[JPUSHService registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:nil];
} else {
//categories 必须为nil
[JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert) categories:nil];
}
#else
//categories 必须为nil
[JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert) categories:nil];
#endif


/*
Expand All @@ -77,7 +77,7 @@
apsForProduction: YES: 发布环境;NO: 开发环境。
*/
[JPUSHService setupWithOption:launchOptions appKey:@"abcacdf406411fa656ee11c3" channel:@"" apsForProduction:NO];

/*
使用 IDFA 启动 SDK(不能与上述方法同时使用)。
参数说明:
Expand All @@ -88,7 +88,7 @@
*/
NSString *advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
[JPUSHService setupWithOption:launchOptions appKey:@"abcacdf406411fa656ee11c3" channel:@"" apsForProduction:NO advertisingIdentifier:advertisingId];

return YES;
}

Expand All @@ -99,36 +99,36 @@
- NO: 开发环境。
- advertisingIdentifier: 根据自身情况选择是否带有 IDFA 的启动方法,并注释另外一个启动方法。

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
// Required.
[JPUSHService registerDeviceToken:deviceToken];
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
// Required.
[JPUSHService handleRemoteNotification:userInfo];
}

// iOS 10 Support
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler {
// Required
NSDictionary * userInfo = notification.request.content.userInfo;
if([notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[JPUSHService handleRemoteNotification:userInfo];
}
[[NSNotificationCenter defaultCenter] postNotificationName:@"JPushPluginReceiveNotification" object:userInfo];
completionHandler(UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound); // 需要执行这个方法,选择是否提醒用户,有Badge、Sound、Alert三种类型可以选择设置
}

// iOS 10 Support
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler {
// Required
NSDictionary * userInfo = response.notification.request.content.userInfo;
if([response.notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[JPUSHService handleRemoteNotification:userInfo];
}
completionHandler(); // 系统要求执行这个方法
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
// Required.
[JPUSHService registerDeviceToken:deviceToken];
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
// Required.
[JPUSHService handleRemoteNotification:userInfo];
}

// iOS 10 Support
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler {
// Required
NSDictionary * userInfo = notification.request.content.userInfo;
if([notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[JPUSHService handleRemoteNotification:userInfo];
}
[[NSNotificationCenter defaultCenter] postNotificationName:@"JPushPluginReceiveNotification" object:userInfo];
completionHandler(UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound); // 需要执行这个方法,选择是否提醒用户,有Badge、Sound、Alert三种类型可以选择设置
}

// iOS 10 Support
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler {
// Required
NSDictionary * userInfo = response.notification.request.content.userInfo;
if([response.notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[JPUSHService handleRemoteNotification:userInfo];
}
completionHandler(); // 系统要求执行这个方法
}

## API 说明
### Android
Expand Down

0 comments on commit 1ef65d5

Please sign in to comment.