AFPushNotificationServiceSDK 0.1.1

AFPushNotificationServiceSDK 0.1.1

测试已测试
Lang语言 Obj-CObjective C
许可证 定制
发布最新发布2017年4月

Daniel Kuhnke 维护。



  • appfarms GmbH & Co. KG

iOS appfarms 推送服务库

变更日志

版本 0.0.18

  • 优化了禁用通知的工作流程

0.0.17, 0.0.16

  • 提高了代码稳定性
  • 编写了 README.md

介绍

appfarms 推送通知服务是一个基于 Web 的 portal,用于向您的应用程序发送远程推送通知并收集有关推送通知的重要统计信息。此库是一个即插即用的静态库,提供了简单地将 Urban Airship 服务集成到您的 iOS 应用程序中的方式。

支持的功能

  1. 启用推送通知: 为您的移动应用程序启用远程推送通知。库会自动将设备令牌注册到 appfarms 推送通知服务,这样您就可以通过 appfarms 推送通知服务的 Web 前端轻松发送远程推送通知。

  2. 分析: 然后开发者可以使用 appfarms 分析报告来衡量

  3. 使用您应用程序的活跃用户的数量。

  4. 特定功能的采用和利用率。

  5. 以及许多其他有用的指标...

本文件包含以下部分

  1. 要求
  2. 配置
    1. 使用 CocoaPods 配置
    2. 启用推送通知
    3. 分析
    4. 自定义参数
  3. 文档
  4. 许可证
  5. 联系

1. 要求

  1. Xcode 7 及以上
  2. SDK 支持 iOS 7.0 及以上
  3. 您需要一个有效的 appfarms 推送通知服务的账号和订阅,以便完整支持 SDK。更多详情请访问 "appfarms 推送通知服务"

2. 配置

我们建议通过 CocoaPods 集成库。

2.2 启用推送通知

Objective-C

  1. 打开您的 AppDelegate.m 文件。
  2. 在文件顶部添加以下行,紧接在您的 import 语句之后:
    #import "AFPushManager.h"
  3. 将以下代码添加到 -application:didFinishLaunchingWithOptions: 中:
    NSString          * apiKey = @"6fe...068";          // Your private apiKey from https://push.appfarms.com
    AFPushEnvironment   env    = AFPushEnvironmentLive; // or `AFPushEnvironmentDebug` or `AFPushEnvironmentStaging`
    
    [AFPushManager configureWithApiKey:apiKey
                           environment:env
                        enableTracking:YES
                      autoTrackingMode:AFPushAutoTrackingModeOptIn];
    
    [AFPushManager handleLaunchOptions:launchOptions];
    
    // Register for remote notifications
    if ([application respondsToSelector:@selector(registerUserNotificationSettings:)])
    {
        UIUserNotificationSettings * settings = nil;
        settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert categories:nil];
        [application registerUserNotificationSettings:settings];
    }
    else
    {
        [application registerForRemoteNotifications];
    }
  4. 将以下代理方法添加到您的 AppDelegate.m 中:
    - (void) application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
    {
        if (notificationSettings.types != UIUserNotificationTypeNone)
        {
            [application registerForRemoteNotifications];
        }
    }
    
    - (void) application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
    {
        [AFPushManager setDeviceToken:deviceToken];
    }
    
    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
    {
        [AFPushManager handlePush:userInfo];
    }

2.3 分析

待办事项

4. 文档

我们的文档可在 appfarms 推送通知服务 上找到。

5. 许可证

版权所有 2015 - 2016 appfarms GmbH & Co KG。保留所有权利。

8. 联系我们

如果您有进一步的问题或遇到任何问题,这些问题无法通过以下步骤解决,请在此处提交 Github 问题或通过以下邮箱联系我们:[email protected]