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;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import org.apache.cordova.CallbackContext;
|
||||
import org.apache.cordova.CordovaInterface;
|
||||
import org.apache.cordova.CordovaPlugin;
|
||||
|
@ -16,11 +18,12 @@ import com.microsoft.appcenter.push.Push;
|
|||
|
||||
public class AppCenterPushPlugin extends CordovaPlugin {
|
||||
private CordovaPushListener listener;
|
||||
private CordovaInterface mCordova;
|
||||
|
||||
@Override
|
||||
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
|
||||
super.initialize(cordova, webView);
|
||||
|
||||
mCordova = cordova;
|
||||
AppCenterShared.configureAppCenter(
|
||||
cordova.getActivity().getApplication(),
|
||||
webView.getPreferences());
|
||||
|
@ -31,6 +34,11 @@ public class AppCenterPushPlugin extends CordovaPlugin {
|
|||
AppCenter.start(Push.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewIntent(Intent intent) {
|
||||
Push.checkLaunchedFromNotification(mCordova.getActivity(), intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(String action, JSONArray args,
|
||||
final CallbackContext callbackContext) throws JSONException {
|
||||
|
|
Загрузка…
Ссылка в новой задаче