mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-01-31 22:42:51 +08:00
iOS - update
1.更新 iOS sdk 2.更改启动 sdk 的方法 3.PushConfig.plist 添加 isIDFA 字段
This commit is contained in:
parent
76b3014417
commit
79fb3b76ca
@ -31,7 +31,7 @@
|
||||
<source-file src="src/ios/Plugins/JPushPlugin.m"/>
|
||||
|
||||
<header-file src="src/ios/lib/JPUSHService.h" />
|
||||
<source-file src="src/ios/lib/jpush-ios-2.1.0.a" framework="true" />
|
||||
<source-file src="src/ios/lib/jpush-ios-2.1.6.a" framework="true" />
|
||||
<header-file src="src/ios/Plugins/AppDelegate+JPush.h"/>
|
||||
<source-file src="src/ios/Plugins/AppDelegate+JPush.m"/>
|
||||
<resource-file src="src/ios/PushConfig.plist" />
|
||||
@ -43,7 +43,8 @@
|
||||
<framework src="Foundation.framework" weak="true" />
|
||||
<framework src="UIKit.framework" weak="true" />
|
||||
<framework src="Security.framework" weak="true" />
|
||||
<framework src="libz.dylib" weak="true" />
|
||||
<framework src="libz.tbd" weak="true" />
|
||||
<framework src="AdSupport.framework" weak="true" />
|
||||
|
||||
<config-file target="*PushConfig.plist" parent="APP_KEY">
|
||||
<string>$API_KEY</string>
|
||||
|
@ -9,10 +9,12 @@
|
||||
#import "JPushPlugin.h"
|
||||
#import "JPUSHService.h"
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <AdSupport/AdSupport.h>
|
||||
|
||||
static NSString *const JM_APP_KEY = @"APP_KEY";
|
||||
static NSString *const JM_APP_CHANNEL = @"CHANNEL";
|
||||
static NSString *const JM_APP_ISPRODUCTION = @"IsProduction";
|
||||
static NSString *const JP_APP_KEY = @"APP_KEY";
|
||||
static NSString *const JP_APP_CHANNEL = @"CHANNEL";
|
||||
static NSString *const JP_APP_ISPRODUCTION = @"IsProduction";
|
||||
static NSString *const JP_APP_ISIDFA = @"isIDFA";
|
||||
static NSString *const JPushConfigFileName = @"PushConfig";
|
||||
static NSDictionary *_luanchOptions = nil;
|
||||
|
||||
@ -273,17 +275,26 @@ static NSDictionary *_luanchOptions = nil;
|
||||
}
|
||||
|
||||
NSMutableDictionary *plistData = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];
|
||||
NSString * appkey = [plistData valueForKey:JM_APP_KEY];
|
||||
NSString * channel = [plistData valueForKey:JM_APP_CHANNEL];
|
||||
NSNumber * isProduction = [plistData valueForKey:JM_APP_ISPRODUCTION];
|
||||
NSString * appkey = [plistData valueForKey:JP_APP_KEY];
|
||||
NSString * channel = [plistData valueForKey:JP_APP_CHANNEL];
|
||||
NSNumber * isProduction = [plistData valueForKey:JP_APP_ISPRODUCTION];
|
||||
NSNumber *isIDFA = [plistData valueForKey:JP_APP_ISIDFA];
|
||||
|
||||
if (!appkey || appkey.length == 0) {
|
||||
NSLog(@"error: app key not found in PushConfig.plist ");
|
||||
assert(0);
|
||||
}
|
||||
|
||||
[JPUSHService setupWithOption:_luanchOptions appKey:appkey
|
||||
channel:channel apsForProduction:[isProduction boolValue] ];
|
||||
NSString *advertisingId = nil;
|
||||
if(isIDFA){
|
||||
advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
|
||||
}
|
||||
[JPUSHService setupWithOption:_luanchOptions
|
||||
appKey:appkey
|
||||
channel:channel
|
||||
apsForProduction:[isProduction boolValue]
|
||||
advertisingIdentifier:advertisingId];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark 将参数返回给js
|
||||
|
@ -8,5 +8,7 @@
|
||||
<string>Subscription</string>
|
||||
<key>IsProduction</key>
|
||||
<false/>
|
||||
<key>isIDFA</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -9,7 +9,7 @@
|
||||
* Copyright (c) 2011 ~ 2015 Shenzhen HXHG. All rights reserved.
|
||||
*/
|
||||
|
||||
#define JPUSH_VERSION_NUMBER 2.1.0
|
||||
#define JPUSH_VERSION_NUMBER 2.1.6
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@ -51,6 +51,7 @@ extern NSString *const kJPFServiceErrorNotification; // 错误提示
|
||||
* @param appKey 一个JPush 应用必须的,唯一的标识. 请参考 JPush 相关说明文档来获取这个标识.
|
||||
* @param channel 发布渠道. 可选.
|
||||
* @param isProduction 是否生产环境. 如果为开发状态,设置为 NO; 如果为生产状态,应改为 YES.
|
||||
* @param advertisingIdentifier 广告标识符(IDFA) 如果不需要使用IDFA,传nil.
|
||||
*
|
||||
* @discussion 提供SDK启动必须的参数, 来启动 SDK.
|
||||
* 此接口必须在 App 启动时调用, 否则 JPush SDK 将无法正常工作.
|
||||
@ -61,6 +62,13 @@ extern NSString *const kJPFServiceErrorNotification; // 错误提示
|
||||
apsForProduction:(BOOL)isProduction;
|
||||
|
||||
|
||||
+ (void)setupWithOption:(NSDictionary *)launchingOption
|
||||
appKey:(NSString *)appKey
|
||||
channel:(NSString *)channel
|
||||
apsForProduction:(BOOL)isProduction
|
||||
advertisingIdentifier:(NSString *)advertisingId;
|
||||
|
||||
|
||||
///----------------------------------------------------
|
||||
/// @name APNs about 通知相关
|
||||
///----------------------------------------------------
|
||||
@ -78,6 +86,7 @@ extern NSString *const kJPFServiceErrorNotification; // 错误提示
|
||||
|
||||
+ (void)registerDeviceToken:(NSData *)deviceToken;
|
||||
|
||||
|
||||
/*!
|
||||
* @abstract 处理收到的 APNs 消息
|
||||
*/
|
||||
@ -97,7 +106,7 @@ extern NSString *const kJPFServiceErrorNotification; // 错误提示
|
||||
+ (void) setTags:(NSSet *)tags
|
||||
alias:(NSString *)alias
|
||||
callbackSelector:(SEL)cbSelector
|
||||
target:(id)theTarget;
|
||||
target:(id)theTarget __attribute__((deprecated("JPush 2.1.1 版本已过期")));;
|
||||
|
||||
+ (void) setTags:(NSSet *)tags
|
||||
alias:(NSString *)alias
|
||||
@ -108,9 +117,9 @@ callbackSelector:(SEL)cbSelector
|
||||
callbackSelector:(SEL)cbSelector
|
||||
object:(id)theTarget;
|
||||
|
||||
+ (void) setTags:(NSSet *)tags
|
||||
alias:(NSString *)alias
|
||||
fetchCompletionHandle:(void (^)(int iResCode, NSSet *iTags, NSString *iAlias))completionHandler;
|
||||
+ (void)setTags:(NSSet *)tags
|
||||
alias:(NSString *)alias
|
||||
fetchCompletionHandle:(void (^)(int iResCode, NSSet *iTags, NSString *iAlias))completionHandler;
|
||||
|
||||
+ (void) setTags:(NSSet *)tags
|
||||
aliasInbackground:(NSString *)alias;
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user