Giter Site home page Giter Site logo

corejpush's Introduction


CoreJPush (持续关注[信息公告牌](https://github.com/CharlinFeng/Show)) ========== #### CoreJPush,让您五句代码立即搞定JPush,集成到使用只需要3分钟。没错,3分钟!
# 一.框架准备 #### 1. 拖拽CoreJPush到您的项目中,并添加以下依赖框架
    >.CFNetwork.framework<br/>
    >.CoreFoundation.framework<br/>
    >.CoreTelephony.framework<br/>
    >.SystemConfiguration.framework<br/>
    >.Security.framework<br/>
    >. libz.tbd <br/>
    >. libresolv.tbd <br/>



2. 项目配置

. (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>




二.光速集成

1.注册JPush(一句代码)

请删除您的AppDelgate中所有有关推送的方法,因为CoreJPush内部已经封装。

#import "CoreJPush.h"
//注册JPush
[CoreJPush registerJPush:launchOptions];



2.突破空间限制,在您任意想得到推送数据的地方,三句代码搞定:

  //1.添加一个监听者:此监听者是遵循了CoreJPushProtocol协议
  [CoreJPush addJPushListener:self];
  
  
  //2.你需要在合适的地方(比如dealloc),移除监听者
  [CoreJPush removeJPushListener:self];
  
  
  //3.您已经遵循了CoreJPushProtocol协议,直接在.m文件里面敲did ,Xcode会提示你如下方法:
  -(void)didReceiveRemoteNotification:(NSDictionary *)userInfo{
      NSLog(@"ViewController: %@",userInfo);
  }




三. 定义标签与别名

注:标签与别名为覆盖操作,而非增量操作。传nil为本次设置值忽略,传""为清除操作。

请注意返回block的res值为设置结果,只有res = YES,才表示标签与别名操作成功。

[CoreJPush setTags:[NSSet setWithArray:@[@"movie"]] alias:@"12343242" resBlock:^(BOOL res, NSSet *tags, NSString *alias) {
    
    if(res){
        NSLog(@"设置成功:%@,%@",@(res),tags,alias);
    }else{
        NSLog(@"设置失败");
    }
}];




四. Badge管理

框架内部已经完成封装,你无需管理。




五. 系统通知栏提示信息管理

框架内部已经完成封装,你无需管理。




六. Swift支持

支持Swift只需做一件事情,就是在框架的Common文件夹中的AppDelegate+JPush.h中引入YourAppName-Swift.h即可。

corejpush's People

Contributors

charlinfeng avatar

Watchers

James Cloos avatar 八六一之家 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.