Skip to content

Update starter projects to use configuration-based initialization API. #957

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,25 @@ 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")
// Initialize Parse SDK
// ****************************************************************************

let configuration = ParseClientConfiguration {
// Add your Parse applicationId:
$0.applicationId = "your_application_id"
// Uncomment and add your clientKey (it's not required if you are using Parse Server):
$0.clientKey = "your_client_key"

// Uncomment the following line and change to your Parse Server address;
$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.localDatastoreEnabled = true
}
Parse.initializeWithConfiguration(configuration)

PFUser.enableAutomaticUser()

let defaultACL: PFACL = PFACL()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,25 @@ @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"];
// Initialize Parse SDK
// ****************************************************************************

[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> _Nonnull configuration) {
// Add your Parse applicationId:
configuration.applicationId = @"your_application_id";

// Uncomment and add your clientKey (it's not required if you are using Parse Server):
// configuration.clientKey = @"your_client_key";

// Uncomment the following line and change to your Parse Server address;
// 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 = YES;
}]];

[PFUser enableAutomaticUser];

PFACL *defaultACL = [PFACL ACL];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,26 @@ 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()
// ****************************************************************************
// Initialize Parse SDK
// ****************************************************************************

let configuration = ParseClientConfiguration {
// Add your Parse applicationId:
$0.applicationId = "your_application_id"
// Uncomment and add your clientKey (it's not required if you are using Parse Server):
$0.clientKey = "your_client_key"

// Uncomment the following line and change to your Parse Server address;
$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.localDatastoreEnabled = true
}
Parse.initializeWithConfiguration(configuration)

// ****************************************************************************
// Uncomment and fill in with your Parse credentials:
// Parse.setApplicationId("your_application_id", clientKey: "your_client_key")
//
// 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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,26 @@ @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];
// ****************************************************************************
// Initialize Parse SDK
// ****************************************************************************

[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> _Nonnull configuration) {
// Add your Parse applicationId:
configuration.applicationId = @"your_application_id";

// Uncomment and add your clientKey (it's not required if you are using Parse Server):
// configuration.clientKey = @"your_client_key";

// Uncomment the following line and change to your Parse Server address;
// 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 = YES;
}]];

// ****************************************************************************
// Uncomment and fill in with your Parse credentials:
// [Parse setApplicationId:@"your_application_id" clientKey:@"your_client_key"];
//
// 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/
// [PFFacebookUtils initializeFacebook];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@ 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")
//
// Initialize Parse SDK
// ****************************************************************************

let configuration = ParseClientConfiguration {
// Add your Parse applicationId:
$0.applicationId = "your_application_id"
// Uncomment and add your clientKey (it's not required if you are using Parse Server):
$0.clientKey = "your_client_key"

// Uncomment the following line and change to your Parse Server address;
$0.server = "https://YOUR_PARSE_SERVER/parse"
}
Parse.initializeWithConfiguration(configuration)

PFUser.enableAutomaticUser()

let defaultACL = PFACL()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,24 @@ 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")
// ****************************************************************************
// Initialize Parse SDK
// ****************************************************************************

let configuration = ParseClientConfiguration {
// Add your Parse applicationId:
$0.applicationId = "your_application_id"
// Uncomment and add your clientKey (it's not required if you are using Parse Server):
$0.clientKey = "your_client_key"

// Uncomment the following line and change to your Parse Server address;
$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.localDatastoreEnabled = true
}
Parse.initializeWithConfiguration(configuration)

// Track application opened event in Analytics
PFAnalytics.trackAppOpenedWithLaunchOptions(nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,25 @@ 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")
//
// 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:
// PFFacebookUtils.initializeFacebook()
// Initialize Parse SDK
// ****************************************************************************

let configuration = ParseClientConfiguration {
// Add your Parse applicationId:
$0.applicationId = "your_application_id"
// Uncomment and add your clientKey (it's not required if you are using Parse Server):
$0.clientKey = "your_client_key"

// Uncomment the following line and change to your Parse Server address;
$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.localDatastoreEnabled = true
}
Parse.initializeWithConfiguration(configuration)

PFUser.enableAutomaticUser()

let defaultACL = PFACL()
Expand Down