|
5 | 5 | import com.parse.Parse; |
6 | 6 | import com.parse.Parse.Configuration.Builder; |
7 | 7 | import com.parse.ParseInstallation; |
| 8 | +import com.parse.SaveCallback; |
| 9 | +import com.parse.ParseException; |
8 | 10 |
|
9 | 11 | import github.taivo.parsepushplugin.ParsePushConfigReader; |
10 | 12 | import github.taivo.parsepushplugin.ParsePushConfigException; |
@@ -61,20 +63,33 @@ public void onCreate(){ |
61 | 63 | // |
62 | 64 | //initialize for use with legacy parse.com |
63 | 65 | Parse.initialize(this, config.getAppId(), config.getClientKey()); |
64 | | - } else{ |
| 66 | + } else { |
| 67 | + Log.d(LOGTAG, "ServerUrl " + config.getServerUrl()); |
| 68 | + Log.d(LOGTAG, "NOTE: The trailing slash is important, e.g., https://mydomain.com:1337/parse/"); |
| 69 | + Log.d(LOGTAG, "NOTE: Set the clientKey if your server requires it, otherwise it can be null"); |
65 | 70 | // |
66 | 71 | // initialize for use with opensource parse-server |
67 | 72 | Parse.initialize(new Parse.Configuration.Builder(this) |
68 | 73 | .applicationId(config.getAppId()) |
69 | | - .server(config.getServerUrl()) // The trailing slash is important, e.g., https://mydomain.com:1337/parse/ |
70 | | - .clientKey(config.getClientKey()) // Can be null |
| 74 | + .server(config.getServerUrl()) |
| 75 | + .clientKey(config.getClientKey()) |
71 | 76 | .build() |
72 | 77 | ); |
73 | 78 | } |
74 | 79 |
|
| 80 | + Log.d(LOGTAG, "Saving Installation in background"); |
75 | 81 | // |
76 | 82 | // save installation. Parse.Push will need this to push to the correct device |
77 | | - ParseInstallation.getCurrentInstallation().saveInBackground(); |
| 83 | + ParseInstallation.getCurrentInstallation().saveInBackground(new SaveCallback() { |
| 84 | + @Override |
| 85 | + public void done(ParseException ex) { |
| 86 | + if (null != ex) { |
| 87 | + Log.e(LOGTAG, ex.toString()); |
| 88 | + } else { |
| 89 | + Log.d(LOGTAG, "Installation saved"); |
| 90 | + } |
| 91 | + } |
| 92 | + }); |
78 | 93 |
|
79 | 94 | } catch(ParsePushConfigException ex){ |
80 | 95 | Log.e(LOGTAG, ex.toString()); |
|
0 commit comments