[英]Xtify integration in Worklight / Dojo
I have an app developed in Worklight 6.2, using DoJo framework, and I want to integrate it with Xtify. 我有一个使用DoJo框架在Worklight 6.2中开发的应用程序,我想将其与Xtify集成。 By reading the integration tutorial, I found a problem in the 7th step:
通过阅读集成教程,我在第七步中发现了一个问题:
Step 7:
步骤7:
1.Perform the following steps to edit your main activity class: Add an import for com.ibm.mobilepush.cordova.MobilePushCordovaActivity.
1.执行以下步骤来编辑您的主要活动类:为com.ibm.mobilepush.cordova.MobilePushCordovaActivity添加导入。
2.Make your main activity override MobilePushCordovaActivity instead of CordovaActivity.
2.让您的主要活动覆盖MobilePushCordovaActivity而不是CordovaActivity。
3.If you override the onSaveInstanceState method or the onNewIntent, make sure you call the super class method.
3.如果覆盖onSaveInstanceState方法或onNewIntent,请确保调用超类方法。
However, since I am working with a DoJo application, my Main Activity class already extends anoter class: 但是,由于我正在使用DoJo应用程序,所以我的Main Activity类已经扩展了noter类:
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;
...
How can I proceed with this integration? 如何进行这种集成? I was thinking that maybe I could extend two different classes, but that doens't seem to be possible.
我当时想也许我可以扩展两个不同的类,但这似乎是不可能的。
Take a look into this post: Xtify + Worklight 6.1 integration in android environment 看一下这篇文章: Android环境中的Xtify + Worklight 6.1集成
You probably need to add 您可能需要添加
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
and append this line to your onStart() method: 并将此行添加到onStart()方法:
XtifySDK.start(getApplicationContext(), XTIFY_APP_KEY, PROJECT_NUM);
I would also add these two methods: 我还要添加以下两种方法:
@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);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.