Skip to content

Commit 738a472

Browse files
committedDec 26, 2024
android sdk 2.8.4
1 parent b76900a commit 738a472

6 files changed

+39
-4
lines changed
 

Diff for: ‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cordova-plugin-openinstall",
3-
"version": "2.2.0",
3+
"version": "2.3.0",
44
"cordova": {
55
"id": "cordova-plugin-openinstall",
66
"platforms": [

Diff for: ‎plugin.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<plugin id="cordova-plugin-openinstall" version="2.2.0"
2+
<plugin id="cordova-plugin-openinstall" version="2.3.0"
33
xmlns="http://apache.org/cordova/ns/plugins/1.0"
44
xmlns:android="http://schemas.android.com/apk/res/android">
55

@@ -47,7 +47,7 @@
4747
</edit-config>
4848

4949
<source-file src="src/android/OpenInstallPlugin.java" target-dir="src/io/openinstall/cordova" />
50-
<lib-file src="src/android/lib/OpenInstall_v2.7.0.jar" target-dir="libs" />
50+
<lib-file src="src/android/lib/OpenInstall_v2.8.4.jar" target-dir="libs" />
5151

5252
</platform>
5353

Diff for: ‎src/android/OpenInstallPlugin.java

+26-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.fm.openinstall.listener.AppInstallAdapter;
1010
import com.fm.openinstall.listener.AppInstallRetryAdapter;
1111
import com.fm.openinstall.listener.AppWakeUpListener;
12+
import com.fm.openinstall.listener.ResultCallback;
1213
import com.fm.openinstall.model.AppData;
1314
import com.fm.openinstall.model.Error;
1415

@@ -35,14 +36,15 @@ public class OpenInstallPlugin extends CordovaPlugin {
3536
private static final String METHOD_WAKEUP = "registerWakeUpHandler";
3637
private static final String METHOD_REGISTER = "reportRegister";
3738
private static final String METHOD_EFFECT = "reportEffectPoint";
39+
private static final String METHOD_SHARE = "reportShare";
3840

3941
private Configuration configuration = null;
4042
private CallbackContext wakeupCallbackContext = null;
4143

4244
@Override
4345
protected void pluginInitialize() {
4446
super.pluginInitialize();
45-
// init();
47+
OpenInstall.preInit(cordova.getActivity());
4648
}
4749

4850
@Override
@@ -72,6 +74,9 @@ public boolean execute(String action, CordovaArgs args, CallbackContext callback
7274
} else if (METHOD_EFFECT.equals(action)) {
7375
reportEffectPoint(args, callbackContext);
7476
return true;
77+
} else if (METHOD_SHARE.equals(action)) {
78+
reportShare(args, callbackContext);
79+
return true;
7580
}
7681
return false;
7782
}
@@ -231,6 +236,26 @@ protected void reportEffectPoint(CordovaArgs args, final CallbackContext callbac
231236
}
232237
}
233238

239+
protected void reportShare(CordovaArgs args, final CallbackContext callbackContext) {
240+
if (args != null && !args.isNull(0) && !args.isNull(1)) {
241+
String shareCode = args.optString(0);
242+
String sharePlatform = args.optString(1);
243+
Log.d(TAG, "reportShare # shareCode:" + shareCode + ", sharePlatform:" + sharePlatform);
244+
OpenInstall.reportShare(shareCode, sharePlatform, new ResultCallback<Void>(){
245+
@Override
246+
public void onResult(Void ignore, Error error) {
247+
if(error != null){
248+
callbackContext.error(error.toString());
249+
}else{
250+
callbackContext.success(1);
251+
}
252+
}
253+
});
254+
}else{
255+
callbackContext.error("参数错误");
256+
}
257+
}
258+
234259
private JSONObject parseData(AppData appData) {
235260
JSONObject jsonObject = new JSONObject();
236261
if (appData != null) {

Diff for: ‎src/android/lib/OpenInstall_v2.7.0.jar

-90.4 KB
Binary file not shown.

Diff for: ‎src/android/lib/OpenInstall_v2.8.4.jar

175 KB
Binary file not shown.

Diff for: ‎www/cordova-plugin-openinstall.js

+10
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ module.exports = {
8989
reportEffectPoint: function(pointId, pointValue, extras){
9090
function pass() {};
9191
exec(pass, pass, "OpenInstallPlugin", "reportEffectPoint", [pointId, pointValue, extras||{}]);
92+
},
93+
94+
/**
95+
* 分享统计
96+
* @param shareCode 分享渠道编号
97+
* @param sharePlatform 分享平台
98+
*/
99+
reportShare: function(onSuccess, onError, shareCode, sharePlatform){
100+
101+
exec(onSuccess, onError, "OpenInstallPlugin", "reportShare", [shareCode, sharePlatform]);
92102
}
93103

94104
};

0 commit comments

Comments
 (0)
Please sign in to comment.