gpt4 book ai didi

ios - Urban Airship 在 iOS 上的实现

转载 作者:行者123 更新时间:2023-11-28 20:23:07 25 4
gpt4 key购买 nike

我正在尝试通过构建阶段 > 将二进制文件与库链接并将库定位到磁盘上来添加 libUAirship-1.4.0.a,这样做之后我仍然收到一条错误消息,提示使用未声明的标识符:UAirshipTakeOffOptionsLaunchOptionsKey,UAirship , UAPush.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.

//Create Airship options dictionary and add the required UIApplication launchOptions
NSMutableDictionary *takeOffOptions = [NSMutableDictionary dictionary];
[takeOffOptions setValue:launchOptions forKey:UAirshipTakeOffOptionsLaunchOptionsKey];

// Call takeOff (which creates the UAirship singleton), passing in the launch options so the
// library can properly record when the app is launched from a push notification. This call is
// required.
//
// Populate AirshipConfig.plist with your app's info from https://go.urbanairship.com
[UAirship takeOff:takeOffOptions];

// Set the icon badge to zero on startup (optional)
[[UAPush shared] resetBadge];

// Register for remote notfications with the UA Library. This call is required.
[[UAPush shared] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeSound |
UIRemoteNotificationTypeAlert)];

// Handle any incoming incoming push notifications.
// This will invoke `handleBackgroundNotification` on your UAPushNotificationDelegate.
[[UAPush shared] handleNotification:[launchOptions valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey]
applicationState:application.applicationState];

return YES;
}

最佳答案

您需要#import 与库关联的头文件,以便符号可用。对于这个库,我相信您想将以下内容添加到源文件的顶部:

#import "UAirship.h"
#import "UAPush.h"

关于ios - Urban Airship 在 iOS 上的实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15131933/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com