diff --git a/ParseStarterProject/OSX/ParseOSXStarterProject-Swift/ParseOSXStarterProject/AppDelegate.swift b/ParseStarterProject/OSX/ParseOSXStarterProject-Swift/ParseOSXStarterProject/AppDelegate.swift index 99eedac37..df8293de1 100644 --- a/ParseStarterProject/OSX/ParseOSXStarterProject-Swift/ParseOSXStarterProject/AppDelegate.swift +++ b/ParseStarterProject/OSX/ParseOSXStarterProject-Swift/ParseOSXStarterProject/AppDelegate.swift @@ -17,14 +17,17 @@ class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var window: NSWindow? func applicationDidFinishLaunching(aNotification: NSNotification) { - // Enable storing and querying data from Local Datastore. - // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy. - Parse.enableLocalDatastore() - - // **************************************************************************** - // Uncomment and fill in with your Parse credentials: - // Parse.setApplicationId("your_application_id", clientKey: "your_client_key") - // **************************************************************************** + + let configuration = ParseClientConfiguration { + $0.applicationId = "your_application_id" + $0.clientKey = "your_client_key" + $0.server = "https://YOUR_PARSE_SERVER/parse" + + // Enable storing and querying data from Local Datastore. + // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy. + $0.enableLocalDatastore = true + } + Parse.initializeWithConfiguration(configuration) PFUser.enableAutomaticUser() diff --git a/ParseStarterProject/OSX/ParseOSXStarterProject/ParseOSXStarterProject/AppDelegate.m b/ParseStarterProject/OSX/ParseOSXStarterProject/ParseOSXStarterProject/AppDelegate.m index 8af866b08..d186cd743 100644 --- a/ParseStarterProject/OSX/ParseOSXStarterProject/ParseOSXStarterProject/AppDelegate.m +++ b/ParseStarterProject/OSX/ParseOSXStarterProject/ParseOSXStarterProject/AppDelegate.m @@ -17,14 +17,16 @@ @implementation AppDelegate #pragma mark NSApplicationDelegate - (void)applicationDidFinishLaunching:(NSNotification *)notification { - // Enable storing and querying data from Local Datastore. - // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy. - [Parse enableLocalDatastore]; - // **************************************************************************** - // Uncomment and fill in with your Parse credentials: - // [Parse setApplicationId:@"your_application_id" clientKey:@"your_client_key"]; - // **************************************************************************** + [Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id configuration) { + configuration.applicationId = @"your_application_id"; + configuration.clientKey = "your_client_key" + configuration.server = @"https://YOUR_PARSE_SERVER/parse"; + + // Enable storing and querying data from Local Datastore. + // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy. + configuration.localDatastoreEnabled = true + }]]; [PFUser enableAutomaticUser]; diff --git a/ParseStarterProject/iOS/ParseStarterProject-Swift/ParseStarterProject/AppDelegate.swift b/ParseStarterProject/iOS/ParseStarterProject-Swift/ParseStarterProject/AppDelegate.swift index 8c88242da..e078b015b 100644 --- a/ParseStarterProject/iOS/ParseStarterProject-Swift/ParseStarterProject/AppDelegate.swift +++ b/ParseStarterProject/iOS/ParseStarterProject-Swift/ParseStarterProject/AppDelegate.swift @@ -24,13 +24,19 @@ class AppDelegate: UIResponder, UIApplicationDelegate { //-------------------------------------- func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - // Enable storing and querying data from Local Datastore. - // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy. - Parse.enableLocalDatastore() - - // **************************************************************************** - // Uncomment and fill in with your Parse credentials: - // Parse.setApplicationId("your_application_id", clientKey: "your_client_key") + + + let configuration = ParseClientConfiguration { + $0.applicationId = "your_application_id" + $0.clientKey = "your_client_key" + $0.server = "https://YOUR_PARSE_SERVER/parse" + + // Enable storing and querying data from Local Datastore. + // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy. + $0.enableLocalDatastore = true + } + Parse.initializeWithConfiguration(configuration) + // // If you are using Facebook, uncomment and add your FacebookAppID to your bundle's plist as // described here: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/ diff --git a/ParseStarterProject/iOS/ParseStarterProject/ParseStarterProject/ParseStarterProjectAppDelegate.m b/ParseStarterProject/iOS/ParseStarterProject/ParseStarterProject/ParseStarterProjectAppDelegate.m index 9f46da12b..75650989a 100644 --- a/ParseStarterProject/iOS/ParseStarterProject/ParseStarterProject/ParseStarterProjectAppDelegate.m +++ b/ParseStarterProject/iOS/ParseStarterProject/ParseStarterProject/ParseStarterProjectAppDelegate.m @@ -24,13 +24,18 @@ @implementation ParseStarterProjectAppDelegate #pragma mark UIApplicationDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Enable storing and querying data from Local Datastore. Remove this line if you don't want to - // use Local Datastore features or want to use cachePolicy. - [Parse enableLocalDatastore]; - - // **************************************************************************** - // Uncomment and fill in with your Parse credentials: - // [Parse setApplicationId:@"your_application_id" clientKey:@"your_client_key"]; + + + [Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id configuration) { + configuration.applicationId = @"your_application_id"; + configuration.clientKey = "your_client_key" + configuration.server = @"https://YOUR_PARSE_SERVER/parse"; + + // Enable storing and querying data from Local Datastore. + // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy. + configuration.localDatastoreEnabled = true + }]]; + // // If you are using Facebook, uncomment and add your FacebookAppID to your bundle's plist as // described here: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/ diff --git a/ParseStarterProject/tvOS/ParseStarterProject-Swift/ParseStarter/AppDelegate.swift b/ParseStarterProject/tvOS/ParseStarterProject-Swift/ParseStarter/AppDelegate.swift index 6b3cf12ec..f775308da 100644 --- a/ParseStarterProject/tvOS/ParseStarterProject-Swift/ParseStarter/AppDelegate.swift +++ b/ParseStarterProject/tvOS/ParseStarterProject-Swift/ParseStarter/AppDelegate.swift @@ -21,12 +21,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate { //-------------------------------------- func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - // **************************************************************************** - // - // Uncomment and fill in with your Parse credentials: - // Parse.setApplicationId("your_application_id", clientKey: "your_client_key") - // - // **************************************************************************** + + let configuration = ParseClientConfiguration { + $0.applicationId = "your_application_id" + $0.clientKey = "your_client_key" + $0.server = "https://YOUR_PARSE_SERVER/parse" + } + Parse.initializeWithConfiguration(configuration) PFUser.enableAutomaticUser() diff --git a/ParseStarterProject/watchOS/ParseStarterProject-Swift/ParseStarter Extension/ExtensionDelegate.swift b/ParseStarterProject/watchOS/ParseStarterProject-Swift/ParseStarter Extension/ExtensionDelegate.swift index 6499e3961..1d1ec2fe9 100644 --- a/ParseStarterProject/watchOS/ParseStarterProject-Swift/ParseStarter Extension/ExtensionDelegate.swift +++ b/ParseStarterProject/watchOS/ParseStarterProject-Swift/ParseStarter Extension/ExtensionDelegate.swift @@ -13,12 +13,17 @@ import Parse class ExtensionDelegate: NSObject, WKExtensionDelegate { func applicationDidFinishLaunching() { - // Enable storing and querying data from Local Datastore. - // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy. - Parse.enableLocalDatastore() - - // Make sure to replace with your Parse app credentials: - Parse.setApplicationId("your_application_id", clientKey: "your_client_key") + + let configuration = ParseClientConfiguration { + $0.applicationId = "your_application_id" + $0.clientKey = "your_client_key" + $0.server = "https://YOUR_PARSE_SERVER/parse" + + // Enable storing and querying data from Local Datastore. + // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy. + $0.enableLocalDatastore = true + } + Parse.initializeWithConfiguration(configuration) // Track application opened event in Analytics PFAnalytics.trackAppOpenedWithLaunchOptions(nil) diff --git a/ParseStarterProject/watchOS/ParseStarterProject-Swift/ParseStarterProject/AppDelegate.swift b/ParseStarterProject/watchOS/ParseStarterProject-Swift/ParseStarterProject/AppDelegate.swift index 44beca167..3756171c4 100644 --- a/ParseStarterProject/watchOS/ParseStarterProject-Swift/ParseStarterProject/AppDelegate.swift +++ b/ParseStarterProject/watchOS/ParseStarterProject-Swift/ParseStarterProject/AppDelegate.swift @@ -24,14 +24,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate { //-------------------------------------- func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - // Enable storing and querying data from Local Datastore. - // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy. - Parse.enableLocalDatastore() - - // **************************************************************************** - // Uncomment and fill in with your Parse credentials: - // Parse.setApplicationId("your_application_id", clientKey: "your_client_key") - // + + let configuration = ParseClientConfiguration { + $0.applicationId = "your_application_id" + $0.clientKey = "your_client_key" + $0.server = "https://YOUR_PARSE_SERVER/parse" + + // Enable storing and querying data from Local Datastore. + // Remove this line if you don't want to use Local Datastore features or want to use cachePolicy. + $0.enableLocalDatastore = true + } + Parse.initializeWithConfiguration(configuration) + // If you are using Facebook, uncomment and add your FacebookAppID to your bundle's plist as // described here: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/ // Uncomment the line inside ParseStartProject-Bridging-Header and the following line here: