Sfoglia il codice sorgente

1.更新京东SDK

tags/0.1.3
huaxuan 2 anni fa
parent
commit
8e12e1363b
24 ha cambiato i file con 269 aggiunte e 165 eliminazioni
  1. BIN
     
  2. +0
    -0
     
  3. +0
    -0
     
  4. +0
    -0
     
  5. +0
    -0
     
  6. +0
    -0
     
  7. +14
    -1
      android/src/main/AndroidManifest.xml
  8. +80
    -42
      android/src/main/java/com/jd/jdsdk/JDHelper.java
  9. +26
    -26
      example/.dart_tool/package_config.json
  10. +54
    -54
      example/.dart_tool/package_config_subset
  11. +1
    -1
      example/.flutter-plugins
  12. +1
    -1
      example/.flutter-plugins-dependencies
  13. +24
    -24
      example/.packages
  14. +18
    -0
      example/android/.idea/modules/android.iml
  15. +2
    -2
      example/android/local.properties
  16. +1
    -1
      example/pubspec.lock
  17. +2
    -2
      example/pubspec.yaml
  18. +7
    -5
      ios/Classes/Handler/FlutterKeplerHandler.m
  19. +2
    -2
      ios/Framework/JDSDK.framework/Headers/JDKeplerSDK.h
  20. +36
    -3
      ios/Framework/JDSDK.framework/Headers/KeplerApiManager.h
  21. BIN
     
  22. BIN
     
  23. +0
    -0
     
  24. +1
    -1
      ios/jdsdk.podspec

BIN
Vedi File


+ 0
- 0
Vedi File


+ 0
- 0
Vedi File


+ 0
- 0
Vedi File


+ 0
- 0
Vedi File


+ 0
- 0
Vedi File


+ 14
- 1
android/src/main/AndroidManifest.xml Vedi File

@@ -1,3 +1,16 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jd.jdsdk">
package="com.jd.jdsdk">

<application>
<activity
android:name="com.kepler.jd.sdk.KeplerBackActivity"
android:exported="true"
android:theme="@android:style/Theme.Translucent">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="sdkback${JD_APPKEY}" />
</intent-filter>
</activity>
</application>
</manifest>

+ 80
- 42
android/src/main/java/com/jd/jdsdk/JDHelper.java Vedi File

@@ -1,14 +1,15 @@
package com.jd.jdsdk;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;

import com.jd.kepler.res.ApkResources;
import com.kepler.jd.Listener.AsyncInitListener;
import com.kepler.jd.Listener.OpenAppAction;
import com.kepler.jd.login.KeplerApiManager;
@@ -27,17 +28,18 @@ import io.flutter.plugin.common.PluginRegistry;

public class JDHelper {
private static JDHelper jdHelper;
// private PluginRegistry.Registrar register;
// private PluginRegistry.Registrar register;
// private ActivityPluginBinding binding;
private WeakReference<Activity> mActivity;
KelperTask mKelperTask;
private Activity activity;

Handler mHandler = new Handler();
KeplerAttachParameter mKeplerAttachParameter = new KeplerAttachParameter();//这个是即时性参数 可以设置
LoadingDialog dialog;


private Activity getActivity(){
private Activity getActivity() {
return this.mActivity.get();
// if(null != register){
// return register.activity();
@@ -56,30 +58,40 @@ public class JDHelper {
OpenAppAction mOpenAppAction = new OpenAppAction() {

@Override
public void onStatus(final int status, final String url) {
mHandler.post(new Runnable() {
@Override
public void run() {
if (status == OpenAppAction.OpenAppAction_start) {//开始状态未必一定执行,
dialogShow();
}else {
mKelperTask = null;
dialogDiss();
}
if(status == OpenAppAction.OpenAppAction_result_NoJDAPP) {
// Toast.makeText(getActivity(), "您未安装京东app,你可以手动打开以下链接地址:"+url+" ,code="+status, Toast.LENGTH_SHORT).show();
}else if(status == OpenAppAction.OpenAppAction_result_BlackUrl){
// Toast.makeText(getActivity(), "url不在白名单,你可以手动打开以下链接地址:"+url+" ,code="+status, Toast.LENGTH_SHORT).show();
}else if(status == OpenAppAction.OpenAppAction_result_ErrorScheme){
// Toast.makeText(getActivity(), "呼起协议异常"+" ,code="+status, Toast.LENGTH_SHORT).show();
}else if(status == OpenAppAction.OpenAppAction_result_APP){

}else if(status == OpenAppAction.OpenAppAction_result_NetError){
// Toast.makeText(getActivity(), ApkResources.getSingleton().getString("kepler_check_net")+" ,code="+status+" ,url="+url,Toast.LENGTH_SHORT).show();
}
}
});
public void onStatus(int status) {
if (status == OpenAppAction.OpenAppAction_start) {//开始状态未必一定执行,
// dialogShow();
} else {
mKelperTask = null;
// dialogDiss();
}
}

// @Override
// public void onStatus(final int status, final String url) {
// mHandler.post(new Runnable() {
// @Override
// public void run() {
// if (status == OpenAppAction.OpenAppAction_start) {//开始状态未必一定执行,
// dialogShow();
// }else {
// mKelperTask = null;
// dialogDiss();
// }
// if(status == OpenAppAction.OpenAppAction_result_NoJDAPP) {
// // Toast.makeText(getActivity(), "您未安装京东app,你可以手动打开以下链接地址:"+url+" ,code="+status, Toast.LENGTH_SHORT).show();
// }else if(status == OpenAppAction.OpenAppAction_result_BlackUrl){
// // Toast.makeText(getActivity(), "url不在白名单,你可以手动打开以下链接地址:"+url+" ,code="+status, Toast.LENGTH_SHORT).show();
// }else if(status == OpenAppAction.OpenAppAction_result_ErrorScheme){
// // Toast.makeText(getActivity(), "呼起协议异常"+" ,code="+status, Toast.LENGTH_SHORT).show();
// }else if(status == OpenAppAction.OpenAppAction_result_APP){
//
// }else if(status == OpenAppAction.OpenAppAction_result_NetError){
// // Toast.makeText(getActivity(), ApkResources.getSingleton().getString("kepler_check_net")+" ,code="+status+" ,url="+url,Toast.LENGTH_SHORT).show();
// }
// }
// });
// }
};

private void dialogShow() {
@@ -100,7 +112,7 @@ public class JDHelper {
}

private void dialogDiss() {
if(dialog!=null)
if (dialog != null)
dialog.dismiss();
}

@@ -119,12 +131,13 @@ public class JDHelper {
// }

//第一次调用getInstance register不能为空
public static JDHelper getInstance(ActivityPluginBinding binding){
if (jdHelper == null){
synchronized (JDHelper.class){
public static JDHelper getInstance(ActivityPluginBinding binding) {
if (jdHelper == null) {
synchronized (JDHelper.class) {
jdHelper = new JDHelper();
if(null != binding){
if (null != binding) {
jdHelper.setActivity(binding.getActivity());
jdHelper.activity = binding.getActivity();
}
}
} else {
@@ -134,20 +147,26 @@ public class JDHelper {
}




/**
* 初始化开普勒
*
* @param call
* @param result
*/
public void initKepler(MethodCall call, MethodChannel.Result result){
public void initKepler(MethodCall call, MethodChannel.Result result) {
String appKey = call.argument("appKey");
String appSecret = call.argument("appSecret");
Log.d("flutter-taoke","initKepler"+getActivity());
KeplerApiManager.asyncInitSdk(getActivity().getApplication(), appKey, appSecret, new AsyncInitListener() {
Log.d("flutter-taoke", "initKepler" + getActivity());
Log.d("flutter-taoke", "initKepler:" + appKey + " " + appSecret);
@SuppressLint("HardwareIds") String id = Settings.Secure.getString(
activity.getContentResolver(),
Settings.Secure.ANDROID_ID
);
Log.d("flutter-taoke", "initKeplerId:" + id);
KeplerApiManager.asyncInitSdk(getActivity().getApplication(), appKey, appSecret, id, new AsyncInitListener() {
@Override
public void onSuccess() {
Log.d("京东初始化", "成功");
result.success(PluginResponse.success(null).toMap());
}

@@ -155,26 +174,45 @@ public class JDHelper {
public void onFailure() {
String errorCode = "-1";
String errorMsg = "初始化失败";
Log.d("京东初始化", "失败");
result.success(new PluginResponse(errorCode, errorMsg, null).toMap());
}
});
// KeplerApiManager.asyncInitSdk(getActivity().getApplication(), appKey, appSecret, new AsyncInitListener() {
// @Override
// public void onSuccess() {
// result.success(PluginResponse.success(null).toMap());
// }
//
// @Override
// public void onFailure() {
// String errorCode = "-1";
// String errorMsg = "初始化失败";
// result.success(new PluginResponse(errorCode, errorMsg, null).toMap());
// }
// });
}


/**
* 通过URL方式打开
*
* @param call
* @param result
*/
public void openUrl(MethodCall call, MethodChannel.Result result){
public void openUrl(MethodCall call, MethodChannel.Result result) {
String url = call.argument("url");
if(TextUtils.isEmpty(url)){
if (TextUtils.isEmpty(url)) {
return;
}
mKelperTask = KeplerApiManager.getWebViewService().openAppWebViewPage(getActivity(),
url,
mKeplerAttachParameter,
mOpenAppAction);
try {
mKelperTask = KeplerApiManager.getWebViewService().openJDUrlPage(url,
mKeplerAttachParameter,
activity,
mOpenAppAction, 1500);
} catch (JSONException e) {
e.printStackTrace();
}
}

}

+ 26
- 26
example/.dart_tool/package_config.json Vedi File

@@ -3,61 +3,61 @@
"packages": [
{
"name": "async",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/async-2.8.2",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/async-2.8.2",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "boolean_selector",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "characters",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/characters-1.2.0",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/characters-1.2.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "charcode",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.3.1",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.3.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "clock",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "collection",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "cupertino_icons",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-0.1.3",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-1.0.5",
"packageUri": "lib/",
"languageVersion": "2.0"
"languageVersion": "2.12"
},
{
"name": "fake_async",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.2.0",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.2.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "flutter",
"rootUri": "file:///Users/fnuouser/Documents/code/flutter/packages/flutter",
"rootUri": "file:///Users/fnuo123/flutter/packages/flutter",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "flutter_test",
"rootUri": "file:///Users/fnuouser/Documents/code/flutter/packages/flutter_test",
"rootUri": "file:///Users/fnuo123/flutter/packages/flutter_test",
"packageUri": "lib/",
"languageVersion": "2.12"
},
@@ -69,79 +69,79 @@
},
{
"name": "matcher",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.11",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.11",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "material_color_utilities",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/material_color_utilities-0.1.3",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/material_color_utilities-0.1.3",
"packageUri": "lib/",
"languageVersion": "2.13"
},
{
"name": "meta",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "path",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/path-1.8.0",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/path-1.8.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "sky_engine",
"rootUri": "file:///Users/fnuouser/Documents/code/flutter/bin/cache/pkg/sky_engine",
"rootUri": "file:///Users/fnuo123/flutter/bin/cache/pkg/sky_engine",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "source_span",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.1",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "stack_trace",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "stream_channel",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "string_scanner",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "term_glyph",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "test_api",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.4.8",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.4.8",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "typed_data",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "vector_math",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.1",
"rootUri": "file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.1",
"packageUri": "lib/",
"languageVersion": "2.14"
},
@@ -149,10 +149,10 @@
"name": "jdsdk_example",
"rootUri": "../",
"packageUri": "lib/",
"languageVersion": "2.1"
"languageVersion": "2.12"
}
],
"generated": "2022-03-23T10:13:46.040839Z",
"generated": "2022-11-09T02:46:32.202871Z",
"generator": "pub",
"generatorVersion": "2.16.1"
}

+ 54
- 54
example/.dart_tool/package_config_subset Vedi File

@@ -1,101 +1,101 @@
jdsdk
2.12
file:///Users/fnuo123/Documents/fnuo_project_two/flutter_jdsdk/
file:///Users/fnuo123/Documents/fnuo_project_two/flutter_jdsdk/lib/
async
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/async-2.8.2/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/async-2.8.2/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/async-2.8.2/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/async-2.8.2/lib/
boolean_selector
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0/lib/
characters
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/characters-1.2.0/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/characters-1.2.0/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/characters-1.2.0/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/characters-1.2.0/lib/
charcode
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.3.1/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.3.1/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.3.1/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.3.1/lib/
clock
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0/lib/
collection
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0/lib/
cupertino_icons
2.0
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-0.1.3/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-0.1.3/lib/
2.12
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-1.0.5/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-1.0.5/lib/
fake_async
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.2.0/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.2.0/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.2.0/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.2.0/lib/
matcher
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.11/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.11/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.11/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.11/lib/
material_color_utilities
2.13
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/material_color_utilities-0.1.3/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/material_color_utilities-0.1.3/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/material_color_utilities-0.1.3/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/material_color_utilities-0.1.3/lib/
meta
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0/lib/
path
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/path-1.8.0/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/path-1.8.0/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/path-1.8.0/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/path-1.8.0/lib/
source_span
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.1/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.1/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.1/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.1/lib/
stack_trace
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0/lib/
stream_channel
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0/lib/
string_scanner
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0/lib/
term_glyph
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0/lib/
test_api
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.4.8/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.4.8/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.4.8/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.4.8/lib/
typed_data
2.12
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0/lib/
vector_math
2.14
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.1/
file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.1/lib/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.1/
file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.1/lib/
sky_engine
2.12
file:///Users/fnuouser/Documents/code/flutter/bin/cache/pkg/sky_engine/
file:///Users/fnuouser/Documents/code/flutter/bin/cache/pkg/sky_engine/lib/
file:///Users/fnuo123/flutter/bin/cache/pkg/sky_engine/
file:///Users/fnuo123/flutter/bin/cache/pkg/sky_engine/lib/
flutter
2.12
file:///Users/fnuouser/Documents/code/flutter/packages/flutter/
file:///Users/fnuouser/Documents/code/flutter/packages/flutter/lib/
file:///Users/fnuo123/flutter/packages/flutter/
file:///Users/fnuo123/flutter/packages/flutter/lib/
flutter_test
2.12
file:///Users/fnuouser/Documents/code/flutter/packages/flutter_test/
file:///Users/fnuouser/Documents/code/flutter/packages/flutter_test/lib/
jdsdk
2.12
file:///Users/fnuouser/Documents/code/zhiying/flutter_jdsdk/
file:///Users/fnuouser/Documents/code/zhiying/flutter_jdsdk/lib/
file:///Users/fnuo123/flutter/packages/flutter_test/
file:///Users/fnuo123/flutter/packages/flutter_test/lib/
jdsdk_example
2.1
file:///Users/fnuouser/Documents/code/zhiying/flutter_jdsdk/example/
file:///Users/fnuouser/Documents/code/zhiying/flutter_jdsdk/example/lib/
2.12
file:///Users/fnuo123/Documents/fnuo_project_two/flutter_jdsdk/example/
file:///Users/fnuo123/Documents/fnuo_project_two/flutter_jdsdk/example/lib/
2

+ 1
- 1
example/.flutter-plugins Vedi File

@@ -1,2 +1,2 @@
# This is a generated file; do not edit or check into version control.
jdsdk=/Users/fnuouser/Documents/code/zhiying/flutter_jdsdk/
jdsdk=/Users/fnuo123/Documents/fnuo_project_two/flutter_jdsdk/

+ 1
- 1
example/.flutter-plugins-dependencies Vedi File

@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"jdsdk","path":"/Users/fnuouser/Documents/code/zhiying/flutter_jdsdk/","dependencies":[]}],"android":[{"name":"jdsdk","path":"/Users/fnuouser/Documents/code/zhiying/flutter_jdsdk/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"jdsdk","dependencies":[]}],"date_created":"2022-03-23 18:13:46.127157","version":"2.10.3"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"jdsdk","path":"/Users/fnuo123/Documents/fnuo_project_two/flutter_jdsdk/","dependencies":[]}],"android":[{"name":"jdsdk","path":"/Users/fnuo123/Documents/fnuo_project_two/flutter_jdsdk/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"jdsdk","dependencies":[]}],"date_created":"2022-11-09 10:46:32.385260","version":"2.10.3"}

+ 24
- 24
example/.packages Vedi File

@@ -3,29 +3,29 @@
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2022-03-23 18:13:46.031638.
async:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/async-2.8.2/lib/
boolean_selector:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0/lib/
characters:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/characters-1.2.0/lib/
charcode:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.3.1/lib/
clock:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0/lib/
collection:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0/lib/
cupertino_icons:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-0.1.3/lib/
fake_async:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.2.0/lib/
flutter:file:///Users/fnuouser/Documents/code/flutter/packages/flutter/lib/
flutter_test:file:///Users/fnuouser/Documents/code/flutter/packages/flutter_test/lib/
# Generated by pub on 2022-11-09 10:46:32.184234.
async:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/async-2.8.2/lib/
boolean_selector:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0/lib/
characters:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/characters-1.2.0/lib/
charcode:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.3.1/lib/
clock:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/clock-1.1.0/lib/
collection:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0/lib/
cupertino_icons:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/cupertino_icons-1.0.5/lib/
fake_async:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/fake_async-1.2.0/lib/
flutter:file:///Users/fnuo123/flutter/packages/flutter/lib/
flutter_test:file:///Users/fnuo123/flutter/packages/flutter_test/lib/
jdsdk:../lib/
matcher:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.11/lib/
material_color_utilities:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/material_color_utilities-0.1.3/lib/
meta:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0/lib/
path:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/path-1.8.0/lib/
sky_engine:file:///Users/fnuouser/Documents/code/flutter/bin/cache/pkg/sky_engine/lib/
source_span:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.1/lib/
stack_trace:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0/lib/
stream_channel:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0/lib/
string_scanner:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0/lib/
term_glyph:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0/lib/
test_api:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.4.8/lib/
typed_data:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0/lib/
vector_math:file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.1/lib/
matcher:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.11/lib/
material_color_utilities:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/material_color_utilities-0.1.3/lib/
meta:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.7.0/lib/
path:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/path-1.8.0/lib/
sky_engine:file:///Users/fnuo123/flutter/bin/cache/pkg/sky_engine/lib/
source_span:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.8.1/lib/
stack_trace:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.10.0/lib/
stream_channel:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.1.0/lib/
string_scanner:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.1.0/lib/
term_glyph:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.2.0/lib/
test_api:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.4.8/lib/
typed_data:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0/lib/
vector_math:file:///Users/fnuo123/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.1/lib/
jdsdk_example:lib/

+ 18
- 0
example/android/.idea/modules/android.iml Vedi File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":" />
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" />
<option name="LAST_KNOWN_AGP_VERSION" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/../.." />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

+ 2
- 2
example/android/local.properties Vedi File

@@ -1,2 +1,2 @@
sdk.dir=/Users/fnuouser/Library/Android/sdk
flutter.sdk=/Users/fnuouser/Documents/code/flutter
sdk.dir=/Users/fnuo123/Library/Android/sdk
flutter.sdk=/Users/fnuo123/flutter

+ 1
- 1
example/pubspec.lock Vedi File

@@ -49,7 +49,7 @@ packages:
name: cupertino_icons
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.3"
version: "1.0.5"
fake_async:
dependency: transitive
description:


+ 2
- 2
example/pubspec.yaml Vedi File

@@ -3,7 +3,7 @@ description: Demonstrates how to use the jdsdk plugin.
publish_to: 'none'

environment:
sdk: ">=2.1.0 <3.0.0"
sdk: ">=2.12.0 <3.0.0"

dependencies:
flutter:
@@ -11,7 +11,7 @@ dependencies:

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
cupertino_icons: ^1.0.4

dev_dependencies:
flutter_test:


+ 7
- 5
ios/Classes/Handler/FlutterKeplerHandler.m Vedi File

@@ -9,11 +9,11 @@
NSString *appSecret = call.arguments[@"appSecret"];
NSLog (@"appKey is :%@", appKey);
NSLog (@"appSecret is :%@", appSecret);
[[KeplerApiManager sharedKPService]asyncInitSdk:appKey secretKey:appSecret sucessCallback:^(){
[[KeplerApiManager sharedKPService] asyncInitSdk:appKey secretKey:appSecret sucessCallback:^(){
NSLog (@"success");
result(@"{status:1}");
}failedCallback:^(NSError *error){
NSLog (@"fail");
NSLog (@"fail%@",error);
result(@"{status:0}");
}];
}
@@ -24,10 +24,12 @@
NSInteger jumpType = [[NSNumber numberWithInt:1] integerValue];
// NSDictionary *userInfo = [FlutterKeplerTools nullToNil:call.arguments[@"userInfo"]];
UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
NSLog(@"JDUrl%@",url);
if ([[UIApplication sharedApplication]canOpenURL:[NSURL URLWithString:[NSString stringWithFormat:@"openapp.jdmobile://"]]]) {//判断是否安装京东app
[ [KeplerApiManager sharedKPService]openKeplerPageWithURL:url userInfo:nil successCallback:^{
if ([[UIApplication sharedApplication]canOpenURL:[NSURL URLWithString:[NSString stringWithFormat:@"openapp.jdmobile://"]]]) {
//判断是否安装京东app
// 判断是否安装京东app
[[KeplerApiManager sharedKPService] openKeplerPageWithURL:url userInfo:@{@"mopenbp5" : @""} successCallback:^{
NSLog (@"success");
result(@"{status:1}");
} failedCallback:^(NSInteger code, NSString * _Nonnull url) {


+ 2
- 2
ios/Framework/JDSDK.framework/Headers/JDKeplerSDK.h Vedi File

@@ -15,6 +15,6 @@ FOUNDATION_EXPORT double JDKeplerSDKVersionNumber;
FOUNDATION_EXPORT const unsigned char JDKeplerSDKVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <JDKeplerSDK/PublicHeader.h>
#import<JDSDK/KeplerApiManager.h>
#import<JDSDK/KeplerApiManager.h> //打包SDK用这个
//#import <JDKeplerSDK/KeplerApiManager.h> //依赖demo工程用这个


+ 36
- 3
ios/Framework/JDSDK.framework/Headers/KeplerApiManager.h Vedi File

@@ -4,11 +4,13 @@
// 提供Kepler服务
// Created by JD.K on 16/6/20.
// Copyright © 2016年 JD.K. All rights reserved.
// version 3.0.1
// version 3.0.3

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

/** 初始化成功回调 */
typedef void (^initSuccessCallback)();
/** 初始化失败回调 */
@@ -28,9 +30,25 @@ typedef enum {
KeplerErrorCodeWhited, //本地url不在白名单中
KeplerErrorCodeResponsed, //本地呼起open协议失败
KeplerErrorCodeNoSid, //sid为空
KeplerErrorCodeInValidApp //应用不合法
KeplerErrorCodeInValidApp, //应用不合法
KeplerErrorCodeUnInstalledJXAPP, //未安装京喜app
KeplerErrorCodeOpenJXFailed //无法打开京喜商品,返回h5链接
} KeplerErrorCode;

typedef enum {
KeplerJXErrorCodeSucceed = 0, //正常呼起
KeplerJXErrorCodeReturnUrl = 1, //兜底url
KeplerJXErrorCodeNoSkuUrl = 2, //非sku链接
KeplerJXErrorCodeAnalysisFailed = 3, //逆解析失败
KeplerJXErrorCodeNoParameter = -1, //参数为空
KeplerJXErrorCodeUnusual = -99, //异常
} KeplerJXErrorCode;


FOUNDATION_EXTERN const NSString *kJDKeplerReturnUrl_appName;
FOUNDATION_EXTERN const NSString *kJDKeplerReturnUrl_appSchema;
FOUNDATION_EXTERN const NSString *kJDKeplerReturnUrl_appBundle;

@interface KeplerApiManager : NSObject

@@ -98,7 +116,7 @@ typedef enum {
/**
跳转京东app

@param url 调用方传入的URl参数
@param url 调用方传入的URL参数
@param userInfo 调用sdk时传入的kepler自定义参数
@param failedCallback code 表示错误编码, url 引起调用失败的url
*/
@@ -107,5 +125,20 @@ typedef enum {
successCallback:(OpenSuccessBlock _Nullable)success
failedCallback:(OpenFailedBlock _Nonnull)failure;


/**
根据url跳转京喜App,根据接口返回结果兼容京东App商品跳转
@param url 商品链接
@param userInfo 自定义参数
@param successBlock 呼起App成功的回调
@param failureBlock 呼起失败回调。打开原生App失败会以code+url方式返回,可用webview打开url
@discussion 返回键信息通过userInfo参数传入,需通过外部变量kJDKeplerReturnUrl_appName,kJDKeplerReturnUrl_appSchema,kJDKeplerReturnUrl_appBundle设置key值,对应value分别为接入应用的应用名,schema,Bundle Identifier。
*/
- (void)openJXPageWithUrl:(NSString *)url
userInfo:(NSDictionary *)userInfo
success:(OpenSuccessBlock)successBlock
failure:(OpenFailedBlock)failureBlock;

@end

NS_ASSUME_NONNULL_END

BIN
Vedi File


BIN
Vedi File


+ 0
- 0
Vedi File


+ 1
- 1
ios/jdsdk.podspec Vedi File

@@ -18,7 +18,7 @@ A new Flutter plugin.
s.dependency 'Flutter'
# 京东导入
s.vendored_frameworks = 'Framework/*.framework'
s.vendored_frameworks = 'Framework/JDSDK.framework'
# s.resource = ''
s.platform = :ios, '8.0'


Caricamento…
Annulla
Salva