diff options
| author | Jules Laplace <jules@okfoc.us> | 2017-02-19 04:22:43 +0100 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2017-02-19 04:22:43 +0100 |
| commit | 8f03316d04ba3a51ce16d90ffe94d7611c013652 (patch) | |
| tree | 1e1282bafc0cf5ec1f9df8f79323fb3ad7388637 /StoneIsland/platforms/android | |
| parent | ed12781e91bb9df05d9b0f927f867d5d3c658f6d (diff) | |
get rid of old parse plugin
Diffstat (limited to 'StoneIsland/platforms/android')
12 files changed, 3 insertions, 584 deletions
diff --git a/StoneIsland/platforms/android/AndroidManifest.xml b/StoneIsland/platforms/android/AndroidManifest.xml index b8feb984..4dc128f6 100755 --- a/StoneIsland/platforms/android/AndroidManifest.xml +++ b/StoneIsland/platforms/android/AndroidManifest.xml @@ -22,27 +22,6 @@ <data android:host=" " android:pathPrefix="/" android:scheme=" " /> </intent-filter> </activity> - <service android:name="com.parse.PushService" /> - <receiver android:name="com.parse.ParseBroadcastReceiver"> - <intent-filter> - <action android:name="android.intent.action.BOOT_COMPLETED" /> - <action android:name="android.intent.action.USER_PRESENT" /> - </intent-filter> - </receiver> - <receiver android:exported="false" android:name="org.apache.cordova.core.ParsePluginReceiver"> - <intent-filter> - <action android:name="com.parse.push.intent.RECEIVE" /> - <action android:name="com.parse.push.intent.DELETE" /> - <action android:name="com.parse.push.intent.OPEN" /> - </intent-filter> - </receiver> - <receiver android:name="com.parse.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND"> - <intent-filter> - <action android:name="com.google.android.c2dm.intent.RECEIVE" /> - <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> - <category android:name="us.okfoc.stoneisland" /> - </intent-filter> - </receiver> <activity android:exported="true" android:name="com.adobe.phonegap.push.PushHandlerActivity" android:permission="${applicationId}.permission.PushHandlerActivity" /> <receiver android:name="com.adobe.phonegap.push.BackgroundActionButtonHandler" /> <receiver android:exported="true" android:name="com.google.android.gms.gcm.GcmReceiver" android:permission="com.google.android.c2dm.permission.SEND"> @@ -65,12 +44,8 @@ </application> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="22" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> - <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.VIBRATE" /> - <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> - <permission android:name="us.okfoc.stoneisland.permission.C2D_MESSAGE" android:protectionLevel="signature" /> - <uses-permission android:name="us.okfoc.stoneisland.permission.C2D_MESSAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> diff --git a/StoneIsland/platforms/android/android.json b/StoneIsland/platforms/android/android.json index d345c65d..e93b27be 100755 --- a/StoneIsland/platforms/android/android.json +++ b/StoneIsland/platforms/android/android.json @@ -9,10 +9,6 @@ "parents": { "/*": [ { - "xml": "<feature name=\"ParsePlugin\"><param name=\"android-package\" value=\"org.apache.cordova.core.ParsePlugin\" /></feature>", - "count": 1 - }, - { "xml": "<feature name=\"InAppBrowser\"><param name=\"android-package\" value=\"org.apache.cordova.inappbrowser.InAppBrowser\" /></feature>", "count": 1 }, @@ -63,22 +59,6 @@ "parents": { "/manifest/application": [ { - "xml": "<service android:name=\"com.parse.PushService\" />", - "count": 1 - }, - { - "xml": "<receiver android:name=\"com.parse.ParseBroadcastReceiver\"><intent-filter><action android:name=\"android.intent.action.BOOT_COMPLETED\" /><action android:name=\"android.intent.action.USER_PRESENT\" /></intent-filter></receiver>", - "count": 1 - }, - { - "xml": "<receiver android:exported=\"false\" android:name=\"org.apache.cordova.core.ParsePluginReceiver\"><intent-filter><action android:name=\"com.parse.push.intent.RECEIVE\" /><action android:name=\"com.parse.push.intent.DELETE\" /><action android:name=\"com.parse.push.intent.OPEN\" /></intent-filter></receiver>", - "count": 1 - }, - { - "xml": "<receiver android:name=\"com.parse.GcmBroadcastReceiver\" android:permission=\"com.google.android.c2dm.permission.SEND\"><intent-filter><action android:name=\"com.google.android.c2dm.intent.RECEIVE\" /><action android:name=\"com.google.android.c2dm.intent.REGISTRATION\" /><category android:name=\"us.okfoc.stoneisland\" /></intent-filter></receiver>", - "count": 1 - }, - { "xml": "<activity android:exported=\"true\" android:name=\"com.adobe.phonegap.push.PushHandlerActivity\" android:permission=\"${applicationId}.permission.PushHandlerActivity\" />", "count": 1 }, @@ -106,38 +86,22 @@ "/manifest": [ { "xml": "<uses-permission android:name=\"android.permission.INTERNET\" />", - "count": 2 + "count": 1 }, { "xml": "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />", - "count": 2 + "count": 1 }, { "xml": "<uses-permission android:name=\"android.permission.WAKE_LOCK\" />", - "count": 2 - }, - { - "xml": "<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\" />", "count": 1 }, { "xml": "<uses-permission android:name=\"android.permission.VIBRATE\" />", - "count": 2 - }, - { - "xml": "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\" />", "count": 1 }, { "xml": "<uses-permission android:name=\"com.google.android.c2dm.permission.RECEIVE\" />", - "count": 2 - }, - { - "xml": "<permission android:name=\"us.okfoc.stoneisland.permission.C2D_MESSAGE\" android:protectionLevel=\"signature\" />", - "count": 1 - }, - { - "xml": "<uses-permission android:name=\"us.okfoc.stoneisland.permission.C2D_MESSAGE\" />", "count": 1 }, { @@ -194,16 +158,7 @@ }, "res/values/parseplugin.xml": { "parents": { - "/*": [ - { - "xml": "<string name=\"parse_app_id\">GS82ZxpN8Mecpc53rsyu6aLLGK0W4CKi42J25DLB</string>", - "count": 1 - }, - { - "xml": "<string name=\"parse_client_key\">hQRtQfsgimYnX5PMivtcdXCG9eZhESeyTr0Rd8Sv</string>", - "count": 1 - } - ] + "/*": [] } }, "res/values/strings.xml": { @@ -219,11 +174,6 @@ } }, "installed_plugins": { - "com.parse.cordova.core.pushplugin": { - "APP_ID": "GS82ZxpN8Mecpc53rsyu6aLLGK0W4CKi42J25DLB", - "CLIENT_KEY": "hQRtQfsgimYnX5PMivtcdXCG9eZhESeyTr0Rd8Sv", - "PACKAGE_NAME": "us.okfoc.stoneisland" - }, "cordova-plugin-inappbrowser": { "PACKAGE_NAME": "us.okfoc.stoneisland" }, @@ -272,14 +222,6 @@ "dependent_plugins": {}, "modules": [ { - "file": "plugins/com.parse.cordova.core.pushplugin/www/cdv-plugin-parse.js", - "id": "com.parse.cordova.core.pushplugin.ParsePlugin", - "pluginId": "com.parse.cordova.core.pushplugin", - "clobbers": [ - "window.parsePlugin" - ] - }, - { "file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js", "id": "cordova-plugin-inappbrowser.inappbrowser", "pluginId": "cordova-plugin-inappbrowser", @@ -386,7 +328,6 @@ } ], "plugin_metadata": { - "com.parse.cordova.core.pushplugin": "0.1.0", "cordova-plugin-inappbrowser": "1.5.0", "cordova-plugin-x-socialsharing": "5.1.3", "cordova-plugin-customurlscheme": "4.2.0", diff --git a/StoneIsland/platforms/android/assets/www/cordova_plugins.js b/StoneIsland/platforms/android/assets/www/cordova_plugins.js index 722b1683..3db0cfd0 100755 --- a/StoneIsland/platforms/android/assets/www/cordova_plugins.js +++ b/StoneIsland/platforms/android/assets/www/cordova_plugins.js @@ -1,14 +1,6 @@ cordova.define('cordova/plugin_list', function(require, exports, module) { module.exports = [ { - "file": "plugins/com.parse.cordova.core.pushplugin/www/cdv-plugin-parse.js", - "id": "com.parse.cordova.core.pushplugin.ParsePlugin", - "pluginId": "com.parse.cordova.core.pushplugin", - "clobbers": [ - "window.parsePlugin" - ] - }, - { "file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js", "id": "cordova-plugin-inappbrowser.inappbrowser", "pluginId": "cordova-plugin-inappbrowser", @@ -117,7 +109,6 @@ module.exports = [ module.exports.metadata = // TOP OF METADATA { - "com.parse.cordova.core.pushplugin": "0.1.0", "cordova-plugin-inappbrowser": "1.5.0", "cordova-plugin-x-socialsharing": "5.1.3", "cordova-plugin-customurlscheme": "4.2.0", diff --git a/StoneIsland/platforms/android/assets/www/plugins/com.parse.cordova.core.pushplugin/www/cdv-plugin-parse.js b/StoneIsland/platforms/android/assets/www/plugins/com.parse.cordova.core.pushplugin/www/cdv-plugin-parse.js deleted file mode 100755 index e732f80d..00000000 --- a/StoneIsland/platforms/android/assets/www/plugins/com.parse.cordova.core.pushplugin/www/cdv-plugin-parse.js +++ /dev/null @@ -1,97 +0,0 @@ -cordova.define("com.parse.cordova.core.pushplugin.ParsePlugin", function(require, exports, module) { var parsePlugin = { - - registerCallback: function(ecb, successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'registerCallback', - [ecb] - ); - }, - - initialize: function(appId, clientKey, successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'initialize', - [appId, clientKey] - ); - }, - - getInstallationId: function(successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'getInstallationId', - [] - ); - }, - - getInstallationObjectId: function(successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'getInstallationObjectId', - [] - ); - }, - - getSubscriptions: function(successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'getSubscriptions', - [] - ); - }, - - subscribe: function(channel, successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'subscribe', - [ channel ] - ); - }, - - unsubscribe: function(channel, successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'unsubscribe', - [ channel ] - ); - }, - - // iOS only - resetBadge: function(successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'resetBadge', - [] - ); - }, - - // iOS only - trackEvent: function(name, dimensions, successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'trackEvent', - [ name, dimensions ] - ); - } -}; -module.exports = parsePlugin; - -}); diff --git a/StoneIsland/platforms/android/libs/Parse-1.9.0.jar b/StoneIsland/platforms/android/libs/Parse-1.9.0.jar Binary files differdeleted file mode 100755 index 90ab97cc..00000000 --- a/StoneIsland/platforms/android/libs/Parse-1.9.0.jar +++ /dev/null diff --git a/StoneIsland/platforms/android/libs/bolts-android-1.1.4.jar b/StoneIsland/platforms/android/libs/bolts-android-1.1.4.jar Binary files differdeleted file mode 100755 index d04acb3b..00000000 --- a/StoneIsland/platforms/android/libs/bolts-android-1.1.4.jar +++ /dev/null diff --git a/StoneIsland/platforms/android/platform_www/cordova_plugins.js b/StoneIsland/platforms/android/platform_www/cordova_plugins.js index 722b1683..3db0cfd0 100755 --- a/StoneIsland/platforms/android/platform_www/cordova_plugins.js +++ b/StoneIsland/platforms/android/platform_www/cordova_plugins.js @@ -1,14 +1,6 @@ cordova.define('cordova/plugin_list', function(require, exports, module) { module.exports = [ { - "file": "plugins/com.parse.cordova.core.pushplugin/www/cdv-plugin-parse.js", - "id": "com.parse.cordova.core.pushplugin.ParsePlugin", - "pluginId": "com.parse.cordova.core.pushplugin", - "clobbers": [ - "window.parsePlugin" - ] - }, - { "file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js", "id": "cordova-plugin-inappbrowser.inappbrowser", "pluginId": "cordova-plugin-inappbrowser", @@ -117,7 +109,6 @@ module.exports = [ module.exports.metadata = // TOP OF METADATA { - "com.parse.cordova.core.pushplugin": "0.1.0", "cordova-plugin-inappbrowser": "1.5.0", "cordova-plugin-x-socialsharing": "5.1.3", "cordova-plugin-customurlscheme": "4.2.0", diff --git a/StoneIsland/platforms/android/platform_www/plugins/com.parse.cordova.core.pushplugin/www/cdv-plugin-parse.js b/StoneIsland/platforms/android/platform_www/plugins/com.parse.cordova.core.pushplugin/www/cdv-plugin-parse.js deleted file mode 100755 index e732f80d..00000000 --- a/StoneIsland/platforms/android/platform_www/plugins/com.parse.cordova.core.pushplugin/www/cdv-plugin-parse.js +++ /dev/null @@ -1,97 +0,0 @@ -cordova.define("com.parse.cordova.core.pushplugin.ParsePlugin", function(require, exports, module) { var parsePlugin = { - - registerCallback: function(ecb, successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'registerCallback', - [ecb] - ); - }, - - initialize: function(appId, clientKey, successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'initialize', - [appId, clientKey] - ); - }, - - getInstallationId: function(successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'getInstallationId', - [] - ); - }, - - getInstallationObjectId: function(successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'getInstallationObjectId', - [] - ); - }, - - getSubscriptions: function(successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'getSubscriptions', - [] - ); - }, - - subscribe: function(channel, successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'subscribe', - [ channel ] - ); - }, - - unsubscribe: function(channel, successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'unsubscribe', - [ channel ] - ); - }, - - // iOS only - resetBadge: function(successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'resetBadge', - [] - ); - }, - - // iOS only - trackEvent: function(name, dimensions, successCallback, errorCallback) { - cordova.exec( - successCallback, - errorCallback, - 'ParsePlugin', - 'trackEvent', - [ name, dimensions ] - ); - } -}; -module.exports = parsePlugin; - -}); diff --git a/StoneIsland/platforms/android/res/values/parseplugin.xml b/StoneIsland/platforms/android/res/values/parseplugin.xml deleted file mode 100755 index 771d375e..00000000 --- a/StoneIsland/platforms/android/res/values/parseplugin.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version='1.0' encoding='utf-8'?> -<resources> - <string name="parse_app_id">GS82ZxpN8Mecpc53rsyu6aLLGK0W4CKi42J25DLB</string> - <string name="parse_client_key">hQRtQfsgimYnX5PMivtcdXCG9eZhESeyTr0Rd8Sv</string> -</resources> diff --git a/StoneIsland/platforms/android/res/xml/config.xml b/StoneIsland/platforms/android/res/xml/config.xml index 00961deb..95df2f20 100644 --- a/StoneIsland/platforms/android/res/xml/config.xml +++ b/StoneIsland/platforms/android/res/xml/config.xml @@ -1,8 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> <widget id="us.okfoc.stoneisland" version="0.8.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> - <feature name="ParsePlugin"> - <param name="android-package" value="org.apache.cordova.core.ParsePlugin" /> - </feature> <feature name="InAppBrowser"> <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser" /> </feature> diff --git a/StoneIsland/platforms/android/src/org/apache/cordova/core/ParsePlugin.java b/StoneIsland/platforms/android/src/org/apache/cordova/core/ParsePlugin.java deleted file mode 100755 index 0ae772be..00000000 --- a/StoneIsland/platforms/android/src/org/apache/cordova/core/ParsePlugin.java +++ /dev/null @@ -1,216 +0,0 @@ -package org.apache.cordova.core; - -import android.app.Application; -import android.util.Log; - -import java.util.Set; - -import org.apache.cordova.CallbackContext; -import org.apache.cordova.CordovaPlugin; -import org.apache.cordova.CordovaWebView; -import org.apache.cordova.CordovaInterface; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import com.parse.Parse; -import com.parse.ParseInstallation; -import com.parse.PushService; -import com.parse.ParsePush; - -import android.util.Log; - -public class ParsePlugin extends CordovaPlugin { - - private static final String TAG = "ParsePlugin"; - private static final String ACTION_INITIALIZE = "initialize"; - private static final String ACTION_GET_INSTALLATION_ID = "getInstallationId"; - private static final String ACTION_GET_INSTALLATION_OBJECT_ID = "getInstallationObjectId"; - private static final String ACTION_GET_SUBSCRIPTIONS = "getSubscriptions"; - private static final String ACTION_SUBSCRIBE = "subscribe"; - private static final String ACTION_UNSUBSCRIBE = "unsubscribe"; - private static final String ACTION_REGISTER_CALLBACK = "registerCallback"; - - private static CordovaWebView sWebView; - private static String sEventCallback = null; - private static boolean sForeground = false; - private static JSONObject sLaunchNotification = null; - - public static void initializeParseWithApplication(Application app) { - String appId = getStringByKey(app, "parse_app_id"); - String clientKey = getStringByKey(app, "parse_client_key"); - Parse.enableLocalDatastore(app); - Log.d(TAG, "Initializing with parse_app_id: " + appId + " and parse_client_key:" + clientKey); - Parse.initialize(app, appId, clientKey); - } - - private static String getStringByKey(Application app, String key) { - int resourceId = app.getResources().getIdentifier(key, "string", app.getPackageName()); - return app.getString(resourceId); - } - - @Override - public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { - if (action.equals(ACTION_REGISTER_CALLBACK)) { - this.registerCallback(callbackContext, args); - return true; - } - if (action.equals(ACTION_INITIALIZE)) { - this.initialize(callbackContext, args); - return true; - } - if (action.equals(ACTION_GET_INSTALLATION_ID)) { - this.getInstallationId(callbackContext); - return true; - } - - if (action.equals(ACTION_GET_INSTALLATION_OBJECT_ID)) { - this.getInstallationObjectId(callbackContext); - return true; - } - if (action.equals(ACTION_GET_SUBSCRIPTIONS)) { - this.getSubscriptions(callbackContext); - return true; - } - if (action.equals(ACTION_SUBSCRIBE)) { - this.subscribe(args.getString(0), callbackContext); - return true; - } - if (action.equals(ACTION_UNSUBSCRIBE)) { - this.unsubscribe(args.getString(0), callbackContext); - return true; - } - return false; - } - - private void registerCallback(final CallbackContext callbackContext, final JSONArray args) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - sEventCallback = args.getString(0); - callbackContext.success(); - // if the app was opened from a notification, handle it now that the device is ready - handleLaunchNotification(); - } catch (JSONException e) { - callbackContext.error("JSONException"); - } - } - }); - } - - private void initialize(final CallbackContext callbackContext, final JSONArray args) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - String appId = args.getString(0); - String clientKey = args.getString(1); - Parse.initialize(cordova.getActivity(), appId, clientKey); - ParseInstallation.getCurrentInstallation().saveInBackground(); - callbackContext.success(); - } catch (JSONException e) { - callbackContext.error("JSONException"); - } - } - }); - } - - private void getInstallationId(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - String installationId = ParseInstallation.getCurrentInstallation().getInstallationId(); - callbackContext.success(installationId); - } - }); - } - - private void getInstallationObjectId(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - String objectId = ParseInstallation.getCurrentInstallation().getObjectId(); - callbackContext.success(objectId); - } - }); - } - - private void getSubscriptions(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - Set<String> subscriptions = PushService.getSubscriptions(cordova.getActivity()); - callbackContext.success(subscriptions.toString()); - } - }); - } - - private void subscribe(final String channel, final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - ParsePush.subscribeInBackground(channel); - callbackContext.success(); - } - }); - } - - private void unsubscribe(final String channel, final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - ParsePush.unsubscribeInBackground(channel); - callbackContext.success(); - } - }); - } - - /* - * Use the cordova bridge to call the jsCB and pass it jsonPayload as param - */ - public static void javascriptEventCallback(JSONObject jsonPayload) { - if (sEventCallback != null && !sEventCallback.isEmpty() && sWebView != null) { - String snippet = "javascript:" + sEventCallback + "(" + jsonPayload.toString() + ")"; - Log.v(TAG, "javascriptCB: " + snippet); - sWebView.sendJavascript(snippet); - } - } - - @Override - public void initialize(CordovaInterface cordova, CordovaWebView webView) { - super.initialize(cordova, webView); - sEventCallback = null; - sWebView = this.webView; - sForeground = true; - } - - @Override - public void onDestroy() { - super.onDestroy(); - sEventCallback = null; - sWebView = null; - sForeground = false; - } - - @Override - public void onPause(boolean multitasking) { - super.onPause(multitasking); - sForeground = false; - } - - @Override - public void onResume(boolean multitasking) { - super.onResume(multitasking); - sForeground = true; - } - - public static boolean isInForeground() { - return sForeground; - } - - public static void setLaunchNotification(JSONObject jsonPayload) { - sLaunchNotification = jsonPayload; - } - - private void handleLaunchNotification() { - if (isInForeground() && sLaunchNotification != null) { - javascriptEventCallback(sLaunchNotification); - sLaunchNotification = null; - } - } -} diff --git a/StoneIsland/platforms/android/src/org/apache/cordova/core/ParsePluginReceiver.java b/StoneIsland/platforms/android/src/org/apache/cordova/core/ParsePluginReceiver.java deleted file mode 100755 index fa917a48..00000000 --- a/StoneIsland/platforms/android/src/org/apache/cordova/core/ParsePluginReceiver.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.apache.cordova.core; - -import com.parse.ParsePushBroadcastReceiver; -import com.parse.ParseAnalytics; - -import android.app.Activity; -import android.app.TaskStackBuilder; -import android.content.Context; -import android.content.Intent; -import android.os.Build; -import android.net.Uri; -import android.util.Log; - -import org.json.JSONObject; -import org.json.JSONException; - -public class ParsePluginReceiver extends ParsePushBroadcastReceiver -{ - private static final String TAG = "ParsePluginReceiver"; - private static final String RECEIVED_IN_FOREGROUND = "receivedInForeground"; - - @Override - protected void onPushReceive(Context context, Intent intent) { - JSONObject pushData = getPushData(intent); - - if (pushData != null) { - if (ParsePlugin.isInForeground()) { - ParsePlugin.javascriptEventCallback(pushData); - } else { - super.onPushReceive(context, intent); - } - } - } - - @Override - protected void onPushOpen(Context context, Intent intent) { - JSONObject pushData = getPushData(intent); - - if (pushData != null) { - if (ParsePlugin.isInForeground()) { - ParseAnalytics.trackAppOpened(intent); - ParsePlugin.javascriptEventCallback(pushData); - } else { - super.onPushOpen(context, intent); - ParsePlugin.setLaunchNotification(pushData); - } - } - } - - private static JSONObject getPushData(Intent intent){ - JSONObject pushData = null; - try { - pushData = new JSONObject(intent.getStringExtra("com.parse.Data")); - pushData.put(RECEIVED_IN_FOREGROUND, ParsePlugin.isInForeground()); - } catch (JSONException e) { - Log.e(TAG, "JSONException while parsing push data:", e); - } finally{ - return pushData; - } - } -} |
