Worklight / Dojo 中的 Xtify 集成
Xtify integration in Worklight / Dojo
我有一个使用 DoJo 框架在 Worklight 6.2 中开发的应用程序,我想将它与 Xtify 集成。
通过阅读集成教程,发现第7步有问题:
Step 7:
1.Perform the following steps to edit your main activity class: Add an import for com.ibm.mobilepush.cordova.MobilePushCordovaActivity.
2.Make your main activity override MobilePushCordovaActivity instead of
CordovaActivity.
3.If you override the onSaveInstanceState method or the
onNewIntent, make sure you call the super class method.
但是,由于我正在使用 DoJo 应用程序,所以我的 Main Activity class 已经扩展了另一个 class:
import com.worklight.androidgap.WLDroidGap;
public class DojoApp extends WLDroidGap {
private static WebView webViewOverlay;
public static Activity thisapp;
private static final String TAG = "DojoApp";
private static ProgressDialog progressBar;
...
我该如何进行这个整合?我在想也许我可以扩展两个不同的 classes,但这似乎不可能。
看看这个 post:
Xtify + Worklight 6.1 integration in android environment
您可能需要添加
public static final String XTIFY_APP_KEY = "xxxxxxxx-xxxxx-xxxx-xxxxx-xxxxxxxxx";
public static final String PROJECT_NUM = "xxxxxxxxxxxx"; // This is the Google Project Number
并将此行附加到您的 onStart() 方法:
XtifySDK.start(getApplicationContext(), XTIFY_APP_KEY, PROJECT_NUM);
我还要添加这两种方法:
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
MobilePushCordovaPluginUtils.onSaveInstanceState(this, outState);
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
MobilePushCordovaPluginUtils.onNewIntent(this, intent);
}
我有一个使用 DoJo 框架在 Worklight 6.2 中开发的应用程序,我想将它与 Xtify 集成。 通过阅读集成教程,发现第7步有问题:
Step 7:
1.Perform the following steps to edit your main activity class: Add an import for com.ibm.mobilepush.cordova.MobilePushCordovaActivity.
2.Make your main activity override MobilePushCordovaActivity instead of CordovaActivity.
3.If you override the onSaveInstanceState method or the onNewIntent, make sure you call the super class method.
但是,由于我正在使用 DoJo 应用程序,所以我的 Main Activity class 已经扩展了另一个 class:
import com.worklight.androidgap.WLDroidGap;
public class DojoApp extends WLDroidGap {
private static WebView webViewOverlay;
public static Activity thisapp;
private static final String TAG = "DojoApp";
private static ProgressDialog progressBar;
...
我该如何进行这个整合?我在想也许我可以扩展两个不同的 classes,但这似乎不可能。
看看这个 post: Xtify + Worklight 6.1 integration in android environment
您可能需要添加
public static final String XTIFY_APP_KEY = "xxxxxxxx-xxxxx-xxxx-xxxxx-xxxxxxxxx";
public static final String PROJECT_NUM = "xxxxxxxxxxxx"; // This is the Google Project Number
并将此行附加到您的 onStart() 方法:
XtifySDK.start(getApplicationContext(), XTIFY_APP_KEY, PROJECT_NUM);
我还要添加这两种方法:
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
MobilePushCordovaPluginUtils.onSaveInstanceState(this, outState);
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
MobilePushCordovaPluginUtils.onNewIntent(this, intent);
}