Merge pull request #91 from microsoft/fix/background-push
Fix opening from background push notification
This commit is contained in:
Коммит
98f1a9dbaf
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
package com.microsoft.azure.mobile.cordova;
|
package com.microsoft.azure.mobile.cordova;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
|
||||||
import org.apache.cordova.CallbackContext;
|
import org.apache.cordova.CallbackContext;
|
||||||
import org.apache.cordova.CordovaInterface;
|
import org.apache.cordova.CordovaInterface;
|
||||||
import org.apache.cordova.CordovaPlugin;
|
import org.apache.cordova.CordovaPlugin;
|
||||||
|
@ -16,11 +18,12 @@ import com.microsoft.appcenter.push.Push;
|
||||||
|
|
||||||
public class AppCenterPushPlugin extends CordovaPlugin {
|
public class AppCenterPushPlugin extends CordovaPlugin {
|
||||||
private CordovaPushListener listener;
|
private CordovaPushListener listener;
|
||||||
|
private CordovaInterface mCordova;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
|
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
|
||||||
super.initialize(cordova, webView);
|
super.initialize(cordova, webView);
|
||||||
|
mCordova = cordova;
|
||||||
AppCenterShared.configureAppCenter(
|
AppCenterShared.configureAppCenter(
|
||||||
cordova.getActivity().getApplication(),
|
cordova.getActivity().getApplication(),
|
||||||
webView.getPreferences());
|
webView.getPreferences());
|
||||||
|
@ -31,6 +34,11 @@ public class AppCenterPushPlugin extends CordovaPlugin {
|
||||||
AppCenter.start(Push.class);
|
AppCenter.start(Push.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNewIntent(Intent intent) {
|
||||||
|
Push.checkLaunchedFromNotification(mCordova.getActivity(), intent);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(String action, JSONArray args,
|
public boolean execute(String action, JSONArray args,
|
||||||
final CallbackContext callbackContext) throws JSONException {
|
final CallbackContext callbackContext) throws JSONException {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче