XCODE 6.0.1
适用于 Apple iOS 2.7.3 的 IBM 推送通知 SDK
我创建了新项目(所以我的应用程序只是 hello world 应用程序),我按照以下步骤操作。
- 在您的应用程序中实现 IBM Push Notification SDK for Apple iOS
http://developer.xtify.com/display/sdk/Getting+Started+with+Apple+Push+Notification+Service#GettingStartedwithApplePushNotificationService-Implementthe%C2%A0IBMPushNotificationSDKforAppleiOSwithinyourApp
我将以下属性添加到 info.plist。
- NSLocationWhenInUseUsageDescription
- NSLocationAlwaysUsageDescription
我在下面的文件中添加了“-fno-objc-arc”编译器标志,因为 ARC 在 myproject 中有效。
- CompanyInboxViewCell.m
- CompanyCustomInbox.m
- 公司收件箱VC.m
- 公司详情VC.m
- AppDelegate.m
我建造了它。然后我在“XLXtifyOptions.m”文件中的“registerForPush 方法”中遇到以下错误。
捕获在这里
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:107:5: error: use of undeclared identifier 'UIApplication'
UIApplication * app = [UIApplication sharedApplication];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:107:21: error: use of undeclared identifier 'app'
UIApplication * app = [UIApplication sharedApplication];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:107:28: error: use of undeclared identifier 'UIApplication'
UIApplication * app = [UIApplication sharedApplication];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:110:9: error: use of undeclared identifier 'app'
if([app respondsToSelector:@selector(registerForRemoteNotifications)])
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:112:9: error: use of undeclared identifier 'UIUserNotificationType'
UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:113:9: error: use of undeclared identifier 'UIUserNotificationSettings'
UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:113:38: error: use of undeclared identifier 'settings'
UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:113:50: error: use of undeclared identifier 'UIUserNotificationSettings'
UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:114:10: error: use of undeclared identifier 'app'
[app registerUserNotificationSettings: settings];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:115:10: error: use of undeclared identifier 'app'
[app registerForRemoteNotifications];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:120:9: error: use of undeclared identifier 'UIRemoteNotificationType'
UIRemoteNotificationType types = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:13: error: use of undeclared identifier 'types'
types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:21: error: use of undeclared identifier 'UIRemoteNotificationTypeNewsstandContentAvailability'
types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:76: error: use of undeclared identifier 'UIRemoteNotificationTypeBadge'
types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:108: error: use of undeclared identifier 'UIRemoteNotificationTypeSound'
types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:139: error: use of undeclared identifier 'UIRemoteNotificationTypeAlert'
types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:123:10: error: use of undeclared identifier 'app'
[app registerForRemoteNotificationTypes:types];
有任何想法吗?
提前致谢!