【发布时间】:2016-12-15 13:12:16
【问题描述】:
您好,我正在尝试设置 Parse。有人告诉我这个步骤对吗?
这段代码放在哪里?
PFAnalytics.trackAppOpenedWithLaunchOptions(nil)
有人检查我的初始化步骤吗?
我认为它会帮助其他新的 Parse 用户。
谢谢
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
//Hidden statusbar
UIApplication.shared.isStatusBarHidden = true
// Override point for customization after application launch.
Parse.enableLocalDatastore()
Parse.setLogLevel(PFLogLevel.info);
//Initialize Pare
let config = ParseClientConfiguration(block: {
(ParseMutableClientConfiguration) -> Void in
//back4app
ParseMutableClientConfiguration.applicationId = "xxxxxxxxx";
ParseMutableClientConfiguration.clientKey = "xxxxxxxxx";
//Parse LiveQuery Server
ParseMutableClientConfiguration.server = "https://xxxxxxxxx/";
});
Parse.initialize(with: config);
//Initialize Facebook
PFFacebookUtils.initializeFacebook(applicationLaunchOptions: launchOptions)
PFTwitterUtils.initializeWithConsumerKey("xxxxxx", consumerSecret: "xxxxxx")
PFUser.enableAutomaticUser()
buildUserInterface()
// color of window
window?.backgroundColor = UIColor.white
//Set Fabric
Fabric.with([Crashlytics.self])
//register ParseSubclass
configureParse()
let userNotificationTypes: UIUserNotificationType = [.alert, .badge, .sound]
let settings = UIUserNotificationSettings(types: userNotificationTypes, categories: nil)
application.registerUserNotificationSettings(settings)
application.registerForRemoteNotifications()
return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
}
【问题讨论】:
标签: swift parse-platform parse-server