Skip to content

Commit d2794d3

Browse files
committed
Sample app upgrded
1 parent 4fa2b6c commit d2794d3

20 files changed

Lines changed: 3197 additions & 797 deletions

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ android {
3333
defaultConfig {
3434
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
3535
applicationId "io.qonversion.sampleapp"
36-
minSdkVersion 21
36+
minSdkVersion 23
3737
targetSdkVersion 34
3838
versionCode flutterVersionCode.toInteger()
3939
versionName flutterVersionName

example/ios/Flutter/ephemeral/flutter_lldb_helper.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

example/ios/Flutter/ephemeral/flutter_lldbinit

Lines changed: 0 additions & 5 deletions
This file was deleted.

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1212
4CB27CA1276762D900DE51FD /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4CB27CA0276762D900DE51FD /* GoogleService-Info.plist */; };
13-
70A6004A2A4DE85F00B4378E /* QonversionPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 70A600432A4DE85F00B4378E /* QonversionPlugin.m */; };
14-
70A6004B2A4DE85F00B4378E /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70A600442A4DE85F00B4378E /* Extensions.swift */; };
15-
70A6004C2A4DE85F00B4378E /* SwiftQonversionPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70A600462A4DE85F00B4378E /* SwiftQonversionPlugin.swift */; };
16-
70A6004D2A4DE85F00B4378E /* BaseListenerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70A600472A4DE85F00B4378E /* BaseListenerWrapper.swift */; };
17-
70A6004E2A4DE85F00B4378E /* BaseEventStreamHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70A600482A4DE85F00B4378E /* BaseEventStreamHandler.swift */; };
18-
70A6004F2A4DE85F00B4378E /* FlutterError+Custom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70A600492A4DE85F00B4378E /* FlutterError+Custom.swift */; };
1913
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
2014
8876821AD52624FFC742CB13 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B61BD248B3C1CEFD8465871F /* Pods_Runner.framework */; };
2115
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
@@ -43,13 +37,6 @@
4337
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
4438
4CB27CA0276762D900DE51FD /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
4539
6A76C3422936312F0071A79A /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
46-
70A600432A4DE85F00B4378E /* QonversionPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QonversionPlugin.m; sourceTree = "<group>"; };
47-
70A600442A4DE85F00B4378E /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
48-
70A600452A4DE85F00B4378E /* QonversionPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QonversionPlugin.h; sourceTree = "<group>"; };
49-
70A600462A4DE85F00B4378E /* SwiftQonversionPlugin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftQonversionPlugin.swift; sourceTree = "<group>"; };
50-
70A600472A4DE85F00B4378E /* BaseListenerWrapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseListenerWrapper.swift; sourceTree = "<group>"; };
51-
70A600482A4DE85F00B4378E /* BaseEventStreamHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseEventStreamHandler.swift; sourceTree = "<group>"; };
52-
70A600492A4DE85F00B4378E /* FlutterError+Custom.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FlutterError+Custom.swift"; sourceTree = "<group>"; };
5340
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
5441
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
5542
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -85,21 +72,6 @@
8572
name = Frameworks;
8673
sourceTree = "<group>";
8774
};
88-
70A600422A4DE85F00B4378E /* Classes */ = {
89-
isa = PBXGroup;
90-
children = (
91-
70A600432A4DE85F00B4378E /* QonversionPlugin.m */,
92-
70A600442A4DE85F00B4378E /* Extensions.swift */,
93-
70A600452A4DE85F00B4378E /* QonversionPlugin.h */,
94-
70A600462A4DE85F00B4378E /* SwiftQonversionPlugin.swift */,
95-
70A600472A4DE85F00B4378E /* BaseListenerWrapper.swift */,
96-
70A600482A4DE85F00B4378E /* BaseEventStreamHandler.swift */,
97-
70A600492A4DE85F00B4378E /* FlutterError+Custom.swift */,
98-
);
99-
name = Classes;
100-
path = ../../macos/Classes;
101-
sourceTree = "<group>";
102-
};
10375
9740EEB11CF90186004384FC /* Flutter */ = {
10476
isa = PBXGroup;
10577
children = (
@@ -114,7 +86,6 @@
11486
97C146E51CF9000F007C117D = {
11587
isa = PBXGroup;
11688
children = (
117-
70A600422A4DE85F00B4378E /* Classes */,
11889
4CB27CA0276762D900DE51FD /* GoogleService-Info.plist */,
11990
9740EEB11CF90186004384FC /* Flutter */,
12091
97C146F01CF9000F007C117D /* Runner */,
@@ -325,14 +296,8 @@
325296
isa = PBXSourcesBuildPhase;
326297
buildActionMask = 2147483647;
327298
files = (
328-
70A6004D2A4DE85F00B4378E /* BaseListenerWrapper.swift in Sources */,
329299
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
330-
70A6004F2A4DE85F00B4378E /* FlutterError+Custom.swift in Sources */,
331-
70A6004A2A4DE85F00B4378E /* QonversionPlugin.m in Sources */,
332300
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
333-
70A6004B2A4DE85F00B4378E /* Extensions.swift in Sources */,
334-
70A6004C2A4DE85F00B4378E /* SwiftQonversionPlugin.swift in Sources */,
335-
70A6004E2A4DE85F00B4378E /* BaseEventStreamHandler.swift in Sources */,
336301
);
337302
runOnlyForDeploymentPostprocessing = 0;
338303
};

example/lib/app_state.dart

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import 'package:flutter/foundation.dart';
2+
import 'package:qonversion_flutter/qonversion_flutter.dart';
3+
4+
/// Global application state for the Qonversion SDK demo app
5+
class AppState extends ChangeNotifier {
6+
// Initialization status
7+
bool _isInitialized = false;
8+
String _initStatus = 'not_initialized'; // not_initialized, initializing, success, error
9+
10+
// Loading state
11+
bool _isLoading = false;
12+
13+
// User info
14+
QUser? _userInfo;
15+
16+
// Products and offerings
17+
Map<String, QProduct>? _products;
18+
QOfferings? _offerings;
19+
20+
// Entitlements
21+
Map<String, QEntitlement>? _entitlements;
22+
23+
// Remote configs
24+
QRemoteConfigList? _remoteConfigs;
25+
26+
// User properties
27+
QUserProperties? _userProperties;
28+
29+
// No-Codes events
30+
List<String> _noCodesEvents = [];
31+
32+
// Getters
33+
bool get isInitialized => _isInitialized;
34+
String get initStatus => _initStatus;
35+
bool get isLoading => _isLoading;
36+
QUser? get userInfo => _userInfo;
37+
Map<String, QProduct>? get products => _products;
38+
QOfferings? get offerings => _offerings;
39+
Map<String, QEntitlement>? get entitlements => _entitlements;
40+
QRemoteConfigList? get remoteConfigs => _remoteConfigs;
41+
QUserProperties? get userProperties => _userProperties;
42+
List<String> get noCodesEvents => _noCodesEvents;
43+
44+
// Setters with notification
45+
void setInitStatus(String status) {
46+
_initStatus = status;
47+
if (status == 'success') {
48+
_isInitialized = true;
49+
}
50+
notifyListeners();
51+
}
52+
53+
void setLoading(bool loading) {
54+
_isLoading = loading;
55+
notifyListeners();
56+
}
57+
58+
void setUserInfo(QUser? user) {
59+
_userInfo = user;
60+
notifyListeners();
61+
}
62+
63+
void setProducts(Map<String, QProduct>? products) {
64+
_products = products;
65+
notifyListeners();
66+
}
67+
68+
void setOfferings(QOfferings? offerings) {
69+
_offerings = offerings;
70+
notifyListeners();
71+
}
72+
73+
void setEntitlements(Map<String, QEntitlement>? entitlements) {
74+
_entitlements = entitlements;
75+
notifyListeners();
76+
}
77+
78+
void setRemoteConfigs(QRemoteConfigList? configs) {
79+
_remoteConfigs = configs;
80+
notifyListeners();
81+
}
82+
83+
void setUserProperties(QUserProperties? properties) {
84+
_userProperties = properties;
85+
notifyListeners();
86+
}
87+
88+
void addNoCodesEvent(String event) {
89+
_noCodesEvents.insert(0, '${DateTime.now().toString().substring(11, 19)}: $event');
90+
if (_noCodesEvents.length > 50) {
91+
_noCodesEvents.removeLast();
92+
}
93+
notifyListeners();
94+
}
95+
96+
void clearNoCodesEvents() {
97+
_noCodesEvents.clear();
98+
notifyListeners();
99+
}
100+
}

0 commit comments

Comments
 (0)