ARNPush 0.1.1

ARNPush 0.1.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布上次发布2014年12月

airin维护。



ARNPush 0.1.1

  • 作者:
  • xxxAIRINxxx

注意

测试期间....

用法

要运行示例项目,请克隆仓库,并首先从 Example 目录运行 pod install

AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [ARNPush setDeviceTokenBlock:^(NSString *deviceToken, NSError *error) {
        if (error) {
            // didFailToRegisterForRemoteNotificationsWithError
        } else {
            // didRegisterForRemoteNotificationsWithDeviceToken
        }
    }];

    [ARNPush setAlertBlock:^(NSDictionary *userInfo) {
        NSLog(@"Call ARNPush Alert Block");
    }];

    [ARNPush setSoundBlock:^(NSDictionary *userInfo) {
        NSLog(@"Call ARNPush Sound Block");
    }];

    [ARNPush setBadgeBlock:^(NSDictionary *userInfo) {
        NSLog(@"Call ARNPush Badge Block");
    }];

    [ARNPush registerForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)
                launchOptions:launchOptions];

    return YES;
}

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
    // call ARNPush DeviceTokenBlock
}

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
    // call ARNPush DeviceTokenBlock
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
   // call ARNPush AlertBlock, SoundBlock, BadgeBlock
}

要求

  • iOS 7.0+
  • ARC

安装

方法交换

替换以下方法。

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo;

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;

// iOS 8.0+ Only
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler;

许可证

ARNPush 基于 MIT 许可证提供。有关更多信息,请参阅 LICENSE 文件。