@@ -26,7 +26,7 @@ class Qonversion {
2626 /// You can provide your own client-side [userId] if needed.
2727 ///
2828 /// Returns `userId` for Ads integrations.
29- static Future <String > initialize (
29+ static Future <String > launch (
3030 String apiKey, {
3131 String userId,
3232 }) async {
@@ -40,38 +40,6 @@ class Qonversion {
4040 return uid;
4141 }
4242
43- /// Launches Qonversion SDK with the given API keys for each platform:
44- /// [androidApiKey] and [iosApiKey] respectively,
45- /// you can get one in your account on qonversion.io.
46- ///
47- /// Returns `userId` for Ads integrations.
48- ///
49- /// **Warning**:
50- /// On iOS Qonversion will track any purchase events (trials, subscriptions, basic purchases) automatically.
51- ///
52- /// On Android you will have to call `Qonversion.trackPurchase(details, purchase)` method to track all
53- /// purchases manually.
54- @Deprecated ('Use Qonversion.initialize with just one API key instead' )
55- static Future <String > launch ({
56- @required String androidApiKey,
57- @required String iosApiKey,
58- String userId,
59- }) async {
60- final apiKey = _obtainPlatformApiKey (
61- androidApiKey: androidApiKey,
62- iosApiKey: iosApiKey,
63- );
64-
65- final args = {
66- Constants .kApiKey: apiKey,
67- Constants .kUserId: userId,
68- };
69-
70- final uid = await _channel.invokeMethod (Constants .mLaunch, args);
71-
72- return uid;
73- }
74-
7543 /// Tracks purchases manually on Android.
7644 ///
7745 /// Returns `null` if `!Platform.isAndroid` .
@@ -113,26 +81,4 @@ class Qonversion {
11381
11482 return _channel.invokeMethod (Constants .mAddAttributionData, args);
11583 }
116-
117- static String _obtainPlatformApiKey ({
118- String androidApiKey,
119- String iosApiKey,
120- }) {
121- String key;
122-
123- if (Platform .isAndroid) {
124- key = androidApiKey;
125- } else if (Platform .isIOS) {
126- key = iosApiKey;
127- } else {
128- throw Exception ('Unsupported platform' );
129- }
130-
131- if (key == null ) {
132- throw Exception (
133- 'Please provide API key for the platform you are running an app on' );
134- }
135-
136- return key;
137- }
13884}
0 commit comments