1

Good day all, I tried connecting to the back4app back end service using the new parse4cn1 lib .....I supplied the keys required but my app could not connect to the backend for some strange reasons.kept reporting (unable to connect to back end.........codename one revisions some long numbers) Some help or direction will be appreciated.Thanks all

rockspetre
  • 325
  • 1
  • 7

2 Answers2

1

What keys are you using? You need to pass your App Id and Client Key to parse4cn1. I just ran the regression tests against back4app and I didn't get any connection error. Can you provide more details (e.g. a dump) of the error you're getting?

  • Good day sir. This is how i used it: Parse.initialize("https://"https://parseapi.back4app.com/","MY_AppId","My ClientKey"): I keep getting an error cant connect to backend. Please help – rockspetre Jan 18 '17 at 16:40
  • That should work. I've used `parse4cn1` in the past few weeks to connect to back4app without any problems... [others](https://www.codenameone.com/blog/migrating-from-parse-back4app.html) too. The information you've provided is too limited for me to be of much help. Do you have log outputs? Are you sure you're using the right key as client key? Are you able to connect via the REST API? – netsuite_insights Jan 19 '17 at 22:40
0

Where are you putting your Parse.initialize? Just went for some digging on parse4cn1 and it seems that it needs to be inside a "initVars" function, usually created within a state machine as you can see in the example below:

public class StateMachine extends StateMachineBase {
    /**
     * this method should be used to initialize variables instead of
     * the constructor/class scope to avoid race conditions
     */
    protected void initVars(Resources res) {
         Parse.initialize(API_ENDPOINT, APP_ID, CLIENT_KEY);
    }

}

Maybe that can help you on this connection issue. Also check the link below (A very useful guide) for further info:

https://github.com/sidiabale/parse4cn1/wiki/Usage-Examples

Casagrande
  • 90
  • 7