0

I wanted to use back4app as my backend to my mobile apps & web app/site. My question is can I access same db and authentication in single project (shared plan). If yes show me some reference to get. Thank you. (Try to understand my English).

Naveen Avidi
  • 3,004
  • 1
  • 11
  • 23

1 Answers1

1

Yes, you can use the same database for your mobile apps and website, you only need to use the same app credentials in your initialization code.

Let me better explain it:

For Android apps, you must use:

Parse.initialize(new Parse.Configuration.Builder(this)
              .applicationId("APP-ID-HERE")
              // if defined
              .clientKey("CLIENT-KEY-HERE")
              .server("https://parseapi.back4app.com")
              .build()
);

For iOS (swift):

let configuration = ParseClientConfiguration {
    $0.applicationId = "PASTE_YOUR_APPLICATION_ID_HERE"
    $0.clientKey = "PASTE_YOUR_CLIENT_ID_HERE"
    $0.server = "https://parseapi.back4app.com"
}
Parse.initialize(with: configuration)

For iOS (obj-C):

[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> configuration) {
    configuration.applicationId = @"PASTE_YOUR_APPLICATION_ID_HERE";
    configuration.clientKey = @"PASTE_YOUR_CLIENT_ID_HERE";
    configuration.server = @"https://parseapi.back4app.com/";
}]];

And for the website (JS):

Parse.initialize("YOUR_APP_ID", "YOUR_JS_KEY"); //PASTE HERE YOUR Back4App APPLICATION ID AND YOUR JavaScript KEY
Parse.serverURL = "https://parseapi.back4app.com/";

If you use the credentials (App ID, Client Key / Javascript Key) of the same app, you'll connect all your "different" projects to the same database.

In addition, you can get these credentials following this guide: https://help.back4app.com/hc/en-us/articles/115000754772-Where-are-my-Keys-and-ID-

Charles
  • 531
  • 2
  • 11