Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version '4.2.0'

buildscript {
ext.kotlin_version = '1.3.50'
ext.qonversion_version = '3.2.2'
ext.qonversion_version = '3.2.4'
repositories {
google()
jcenter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ class QonversionFlutterSdkPlugin : MethodCallHandler, FlutterPlugin, ActivityAwa
"purchaseProduct" -> purchaseProduct(args["product"] as? String, result)
"updatePurchase" -> updatePurchase(args, result)
"updatePurchaseWithProduct" -> updatePurchaseWithProduct(args, result)
"setUserId" -> setUserId(args["userId"] as? String, result)
"setProperty" -> setProperty(args, result)
"setUserProperty" -> setUserProperty(args, result)
"addAttributionData" -> addAttributionData(args, result)
Expand Down Expand Up @@ -280,16 +279,6 @@ class QonversionFlutterSdkPlugin : MethodCallHandler, FlutterPlugin, ActivityAwa
})
}

private fun setUserId(userId: String?, result: Result) {
if (userId == null) {
result.noUserIdError()
return
}

Qonversion.setUserID(userId)
result.success(null)
}

private fun setProperty(args: Map<String, Any>, result: Result) {
val rawProperty = args["property"] as? String ?: return result.noProperty()

Expand Down Expand Up @@ -365,7 +354,7 @@ class QonversionFlutterSdkPlugin : MethodCallHandler, FlutterPlugin, ActivityAwa
if (data.isEmpty()) {
return result.noDataError()
}

val stringsMap: Map<String, String> = data.mapValues { it.value.toString() }
val isQonversionNotification = Qonversion.handleNotification(stringsMap)
result.success(isQonversionNotification)
Expand Down
10 changes: 5 additions & 5 deletions example/lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ class _HomeViewState extends State<HomeView> {
Padding(
padding: const EdgeInsets.all(8.0),
child: FlatButton(
child: Text('Set custom userId'),
color: Colors.blue,
textColor: Colors.white,
onPressed: () => Qonversion.setUserId('userId'),
),
child: Text('Set custom userId'),
color: Colors.blue,
textColor: Colors.white,
onPressed: () => Qonversion.setProperty(
QUserProperty.customUserId, 'userId')),
),
Padding(
padding: const EdgeInsets.only(
Expand Down
2 changes: 1 addition & 1 deletion example/lib/params_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ParamsView extends StatelessWidget {
color: Colors.green,
textColor: Colors.white,
onPressed: () {
Qonversion.setUserId('customId');
Qonversion.setProperty(QUserProperty.customUserId, 'customId');
print('did set user id');
},
),
Expand Down
3 changes: 3 additions & 0 deletions ios/Classes/Mapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ extension Qonversion.Property {
case "KochavaDeviceId":
return .kochavaDeviceID

case "CustomUserId":
return .userID

default:
throw ParsingError.runtimeError("Could not parse Qonversion.Property")
}
Expand Down
13 changes: 0 additions & 13 deletions ios/Classes/SwiftQonversionFlutterSdkPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ public class SwiftQonversionFlutterSdkPlugin: NSObject, FlutterPlugin {
case "promoPurchase":
return promoPurchase(args["productId"] as? String, result)

case "setUserId":
return setUserId(args["userId"] as? String, result)

case "addAttributionData":
return addAttributionData(args, result)

Expand Down Expand Up @@ -264,16 +261,6 @@ public class SwiftQonversionFlutterSdkPlugin: NSObject, FlutterPlugin {
}
}

private func setUserId(_ userId: String?, _ result: @escaping FlutterResult) {
guard let userId = userId else {
result(FlutterError.noUserId)
return
}

Qonversion.setUserID(userId)
result(nil)
}

private func setProperty(_ args: [String: Any], _ result: @escaping FlutterResult) {
guard let rawProperty = args["property"] as? String else {
return result(FlutterError.noProperty)
Expand Down
2 changes: 1 addition & 1 deletion ios/qonversion_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.platform = :ios, '9.0'
s.dependency 'Qonversion', '2.18.0'
s.dependency 'Qonversion', '2.18.1'

# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
Expand Down
1 change: 0 additions & 1 deletion lib/src/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class Constants {
static const mUpdatePurchaseWithProduct = 'updatePurchaseWithProduct';
static const mCheckPermissions = 'checkPermissions';
static const mRestore = 'restore';
static const mSetUserId = 'setUserId';
static const mSetProperty = 'setProperty';
static const mSetUserProperty = 'setUserProperty';
static const mSyncPurchases = 'syncPurchases';
Expand Down
1 change: 1 addition & 0 deletions lib/src/models/user_property.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ enum QUserProperty {
appsFlyerUserId,
adjustAdId,
kochavaDeviceId,
customUserId,
}
4 changes: 3 additions & 1 deletion lib/src/qonversion.dart
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ class Qonversion {
/// Qonversion SDK provides an asynchronous method to set your side User ID that can be used to match users in third-party integrations.
///
/// See more in [documentation](https://documentation.qonversion.io/docs/user-identifiers)
@Deprecated(
"Will be removed in a future major release. Use setProperty(QUserProperty.customUserId, 'value') instead.")
static Future<void> setUserId(String userId) =>
_channel.invokeMethod(Constants.mSetUserId, {Constants.kUserId: userId});
setProperty(QUserProperty.customUserId, userId);

/// Sets user property for pre-defined case property.
///
Expand Down
2 changes: 1 addition & 1 deletion macos/qonversion_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.dependency 'FlutterMacOS'
s.platform = :osx, '10.12'
s.dependency 'Qonversion', '2.18.0'
s.dependency 'Qonversion', '2.18.1'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.0'
s.static_framework = true
Expand Down