测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | 定制 |
发布最新发布 | 2017年4月 |
由 Daniel Kuhnke 维护。
appfarms 推送通知服务是一个基于 Web 的 portal,用于向您的应用程序发送远程推送通知并收集有关推送通知的重要统计信息。此库是一个即插即用的静态库,提供了简单地将 Urban Airship 服务集成到您的 iOS 应用程序中的方式。
支持的功能
启用推送通知: 为您的移动应用程序启用远程推送通知。库会自动将设备令牌注册到 appfarms 推送通知服务,这样您就可以通过 appfarms 推送通知服务的 Web 前端轻松发送远程推送通知。
分析: 然后开发者可以使用 appfarms 分析报告来衡量
使用您应用程序的活跃用户的数量。
特定功能的采用和利用率。
以及许多其他有用的指标...
本文件包含以下部分
我们建议通过 CocoaPods 集成库。
Objective-C
AppDelegate.m
文件。import
语句之后:#import "AFPushManager.h"
-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];
}
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];
}
待办事项
我们的文档可在 appfarms 推送通知服务 上找到。
版权所有 2015 - 2016 appfarms GmbH & Co KG。保留所有权利。
如果您有进一步的问题或遇到任何问题,这些问题无法通过以下步骤解决,请在此处提交 Github 问题或通过以下邮箱联系我们:[email protected]