gpt4 book ai didi

java - Worklight/Dojo 中的 Xtify 集成

转载 作者:行者123 更新时间:2023-11-29 20:33:48 30 4
gpt4 key购买 nike

我有一个使用 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 类已经扩展了另一个类:

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;
...

我该如何继续进行此集成?我在想也许我可以扩展两个不同的类,但这似乎不可能。

最佳答案

看看这个帖子: 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);
}

关于java - Worklight/Dojo 中的 Xtify 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31618586/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com