Skip to content

Commit a4314e2

Browse files
author
WuWenhui
committed
Android SDK 2.7.0
1 parent 1b32355 commit a4314e2

File tree

8 files changed

+52
-37
lines changed

8 files changed

+52
-37
lines changed

.idea/workspace.xml

Lines changed: 22 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 Bytes
Binary file not shown.

android/libs/OpenInstall_v2.6.4.jar

-87.1 KB
Binary file not shown.

android/libs/OpenInstall_v2.7.0.jar

90.4 KB
Binary file not shown.

android/src/main/java/io/openinstall/openinstall_flutter_plugin/OpeninstallFlutterPlugin.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.app.Activity;
44
import android.content.Context;
55
import android.content.Intent;
6+
import android.text.TextUtils;
67
import android.util.Log;
78

89
import androidx.annotation.NonNull;
@@ -135,7 +136,15 @@ public void onInstall(AppData appData, boolean retry) {
135136
} else if (METHOD_EFFECT_POINT.equalsIgnoreCase(call.method)) {
136137
String pointId = call.argument("pointId");
137138
Integer pointValue = call.argument("pointValue");
138-
OpenInstall.reportEffectPoint(pointId, pointValue == null ? 0 : pointValue);
139+
if(TextUtils.isEmpty(pointId) || pointValue == null){
140+
Log.w(TAG, "pointId is empty or pointValue is null");
141+
}else{
142+
Map<String, String> extraMap = call.argument("extras");
143+
// if(extraMap != null) {
144+
// Log.d(TAG, "extra = " + extraMap.toString());
145+
// }
146+
OpenInstall.reportEffectPoint(pointId, pointValue, extraMap);
147+
}
139148
result.success("OK");
140149
} else {
141150
result.notImplemented();

example/.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"openinstall_flutter_plugin","path":"D:\\\\workspace\\\\OP\\\\openinstall_flutter_plugin\\\\","dependencies":[]}],"android":[{"name":"openinstall_flutter_plugin","path":"D:\\\\workspace\\\\OP\\\\openinstall_flutter_plugin\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"openinstall_flutter_plugin","dependencies":[]}],"date_created":"2022-09-23 15:21:31.755660","version":"2.8.1"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"openinstall_flutter_plugin","path":"D:\\\\workspace\\\\op-github\\\\openinstall_flutter_plugin\\\\","dependencies":[]}],"android":[{"name":"openinstall_flutter_plugin","path":"D:\\\\workspace\\\\op-github\\\\openinstall_flutter_plugin\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"openinstall_flutter_plugin","dependencies":[]}],"date_created":"2023-01-09 12:15:33.920081","version":"2.8.1"}

example/lib/main.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'dart:async';
2+
import 'dart:io';
23

34
import 'package:flutter/material.dart';
45
import 'package:openinstall_flutter_plugin/openinstall_flutter_plugin.dart';
@@ -72,6 +73,18 @@ class _MyAppState extends State<MyApp> {
7273
child: const Text('reportEffectPoint',
7374
style: TextStyle(fontSize: 20)),
7475
),
76+
const SizedBox(height: 30),
77+
ElevatedButton(
78+
onPressed: () {
79+
Map<String, String> extraMap = {
80+
"systemVersion": Platform.operatingSystemVersion,
81+
"flutterVersion": Platform.version
82+
};
83+
_openinstallFlutterPlugin.reportEffectPoint("effect_detail", 1, extraMap);
84+
},
85+
child: const Text('reportEffectDetail',
86+
style: TextStyle(fontSize: 20)),
87+
),
7588
],
7689
),
7790
),

lib/openinstall_flutter_plugin.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,12 @@ class OpeninstallFlutterPlugin {
7272
_channel.setMethodCallHandler(_handleMethod);
7373
_channel.invokeMethod("registerWakeup");
7474
if (Platform.isAndroid) {
75+
var args = new Map();
76+
args["alwaysCallback"] = alwaysCallback;
7577
if (permission) {
7678
print("OpenInstallPlugin.initWithPermission 后续版本将移除,请自行进行权限申请");
77-
var args = new Map();
78-
args["alwaysCallback"] = alwaysCallback;
7979
_channel.invokeMethod("initWithPermission", args);
8080
} else {
81-
var args = new Map();
82-
args["alwaysCallback"] = alwaysCallback;
8381
_channel.invokeMethod("init", args);
8482
}
8583
} else {
@@ -114,10 +112,13 @@ class OpeninstallFlutterPlugin {
114112
_channel.invokeMethod('reportRegister');
115113
}
116114

117-
void reportEffectPoint(String pointId, int pointValue) {
115+
void reportEffectPoint(String pointId, int pointValue, [Map<String, String>? extraMap]) {
118116
var args = new Map();
119117
args["pointId"] = pointId;
120118
args["pointValue"] = pointValue;
119+
if(extraMap != null){
120+
args["extras"] = extraMap;
121+
}
121122
_channel.invokeMethod('reportEffectPoint', args);
122123
}
123124

0 commit comments

Comments
 (0)