.CFNetwork.framework
.CoreFoundation.framework
.CoreTelephony.framework
.SystemConfiguration.framework
.Security.framework
. libz.tbd
. (1) 在 "Search Paths" 下的 "User Header Search Paths" 和 "Library Search Paths" 为
$(PROJECT_DIR)/CoreJPush/CoreJPush/Lib
。
. (2) 选中 "Project-Target-Capabilities-Background Modes",勾选 "Remote Notifications"。
. (3) 请修改 CoreJPush 框架内 "Common" 文件夹下 "PushConfig.plist" 的 "Appkey" 为您的 Appkey。
. (4) 如果您的工程需要支持小于7.0的iOS系统,请在 "Build Settings" 中关闭 "bitCode" 选项,否则将无法正常编译通过。
. (5) 允许 XCode7 支持Http传输方法
如果用的是Xcode7时,需要在App项目的plist手动加入以下key和值以支持http传输:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
请删除您 AppDelegate 中所有有关推送的方法,因为 CoreJPush 内部已经封装。
#import "CoreJPush.h"
//注册JPush
[CoreJPush registerJPush:launchOptions];
//1.添加一个监听者:此监听者是遵循了CoreJPushProtocol协议
[CoreJPush addJPushListener:self];
//2.你需要在合适的地方(比如dealloc),移除监听者
[CoreJPush removeJPushListener:self];
//3.您已经遵循了CoreJPushProtocol协议,直接在.m文件里面敲did ,Xcode会提示你如下方法:
-(void)didReceiveRemoteNotification:(NSDictionary *)userInfo{
NSLog(@"ViewController: %@",userInfo);
}
[CoreJPush setTags:[NSSet setWithArray:@[@"movie"]] alias:@"12343242" resBlock:^(BOOL res, NSSet *tags, NSString *alias) {
if(res){
NSLog(@"设置成功:%@,%@",@(res),tags,alias);
}else{
NSLog(@"设置失败");
}
}];