Skip to content

Commit a57104b

Browse files
authored
Merge pull request #362 from qonversion/release/9.1.4
Release 9.1.4
2 parents 3ff9389 + b5fc2d6 commit a57104b

17 files changed

+237
-325
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 9.1.4
2+
* Added Tenjin AIID property for Tenjin integration
3+
* The setNotificationToken, handleNotification, and `getNotificationCustomPayload` methods were marked as deprecated.
4+
15
## 9.1.3
26
* Updated restore logic to process huge sandbox receipts faster.
37
* Fixed [products issue](https://github.com/qonversion/qonversion-ios-sdk/issues/507).

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ android {
5151

5252
dependencies {
5353
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
54-
implementation "io.qonversion.sandwich:sandwich:5.1.4"
54+
implementation "io.qonversion.sandwich:sandwich:5.1.6"
5555
implementation 'com.google.code.gson:gson:2.9.0'
5656
}

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -267,34 +267,14 @@
267267
);
268268
inputPaths = (
269269
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
270-
"${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework",
271-
"${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework",
272-
"${BUILT_PRODUCTS_DIR}/FirebaseCoreInternal/FirebaseCoreInternal.framework",
273-
"${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework",
274-
"${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework",
275-
"${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework",
276-
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
277-
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
278270
"${BUILT_PRODUCTS_DIR}/Qonversion/Qonversion.framework",
279271
"${BUILT_PRODUCTS_DIR}/QonversionSandwich/QonversionSandwich.framework",
280-
"${BUILT_PRODUCTS_DIR}/flutter_local_notifications/flutter_local_notifications.framework",
281-
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
282272
"${BUILT_PRODUCTS_DIR}/qonversion_flutter/qonversion_flutter.framework",
283273
);
284274
name = "[CP] Embed Pods Frameworks";
285275
outputPaths = (
286-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework",
287-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework",
288-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreInternal.framework",
289-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework",
290-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework",
291-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework",
292-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
293-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
294276
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Qonversion.framework",
295277
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QonversionSandwich.framework",
296-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_local_notifications.framework",
297-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
298278
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/qonversion_flutter.framework",
299279
);
300280
runOnlyForDeploymentPostprocessing = 0;

example/lib/constants.dart

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

example/lib/handling_notification.dart

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

example/lib/home.dart

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import 'dart:async';
22
import 'dart:io';
33

4-
import 'package:firebase_messaging/firebase_messaging.dart';
54
import 'package:flutter/foundation.dart';
65
import 'package:flutter/material.dart';
76
import 'package:qonversion_flutter/qonversion_flutter.dart';
8-
import 'handling_notification.dart';
97

108
class HomeView extends StatefulWidget {
119
@override
@@ -27,24 +25,6 @@ class _HomeViewState extends State<HomeView> {
2725
super.initState();
2826
_initPlatformState();
2927

30-
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
31-
showNotification(message);
32-
});
33-
34-
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage? message) {
35-
if (message != null) {
36-
onNotificationClick(message.data);
37-
}
38-
});
39-
40-
FirebaseMessaging.instance
41-
.getInitialMessage()
42-
.then((RemoteMessage? message) {
43-
if (message != null) {
44-
onNotificationClick(message.data);
45-
}
46-
});
47-
4828
_shownScreensStream =
4929
Automations.getSharedInstance().shownScreensStream.listen((event) {
5030
// do any logic you need
@@ -177,7 +157,6 @@ class _HomeViewState extends State<HomeView> {
177157
.build();
178158
Qonversion.initialize(config);
179159
Qonversion.getSharedInstance().collectAppleSearchAdsAttribution();
180-
_sendNotificationsToken();
181160
_loadQonversionObjects();
182161
}
183162

@@ -194,31 +173,6 @@ class _HomeViewState extends State<HomeView> {
194173
setState(() {});
195174
}
196175

197-
Future<void> _sendNotificationsToken() async {
198-
String? deviceToken;
199-
switch (defaultTargetPlatform) {
200-
case TargetPlatform.android:
201-
{
202-
deviceToken = await FirebaseMessaging.instance.getToken();
203-
}
204-
break;
205-
206-
case TargetPlatform.iOS:
207-
{
208-
deviceToken = await FirebaseMessaging.instance.getAPNSToken();
209-
}
210-
break;
211-
default:
212-
deviceToken = null;
213-
break;
214-
}
215-
216-
if (deviceToken != null) {
217-
Automations.getSharedInstance().setNotificationsToken(deviceToken);
218-
print('Device token: $deviceToken');
219-
}
220-
}
221-
222176
List<Widget> _entitlementsFromMap(Map<String, QEntitlement> entitlements) {
223177
return entitlements.entries.map<Widget>((e) {
224178
var title = e.value.productId +

example/lib/main.dart

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,12 @@
1-
import 'dart:io';
2-
31
import 'package:flutter/material.dart';
4-
import 'package:qonversion_example/constants.dart';
52

6-
import 'handling_notification.dart';
73
import 'home.dart';
84
import 'params_view.dart';
95
import 'products_view.dart';
106
import 'dart:async';
117

12-
import 'package:firebase_core/firebase_core.dart';
13-
import 'package:firebase_messaging/firebase_messaging.dart';
14-
import 'package:flutter/foundation.dart';
15-
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
16-
import 'dart:convert';
17-
18-
/// Define a top-level named handler which background/terminated messages will
19-
/// call.
20-
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
21-
print('Handling a background message ${message.messageId}');
22-
showNotification(message);
23-
}
24-
25-
/// Initialize the [FlutterLocalNotificationsPlugin] package.
26-
late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
27-
28-
/// Create a [AndroidNotificationChannel] for heads up notifications
29-
late AndroidNotificationChannel channel;
30-
318
Future<void> main() async {
329
WidgetsFlutterBinding.ensureInitialized();
33-
await Firebase.initializeApp();
34-
35-
// Set the background messaging handler early on, as a named top-level function
36-
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
37-
38-
if (!kIsWeb) {
39-
channel = const AndroidNotificationChannel(
40-
Constants.channelId, // id
41-
Constants.channelName, // name
42-
importance: Importance.high,
43-
);
44-
45-
/// Configure FlutterLocalNotificationsPlugin
46-
flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
47-
var initializationSettingsAndroid =
48-
AndroidInitializationSettings('launch_background');
49-
var initializationSettingsIOS = DarwinInitializationSettings(
50-
requestAlertPermission: true,
51-
requestBadgePermission: true,
52-
requestSoundPermission: false);
53-
var initializationSettings = InitializationSettings(
54-
android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
55-
56-
await flutterLocalNotificationsPlugin.initialize(initializationSettings,
57-
onDidReceiveNotificationResponse: (NotificationResponse details) async {
58-
var notificationData = jsonDecode(details.payload ?? "{}");
59-
onNotificationClick(notificationData);
60-
});
61-
62-
/// Create an Android Notification Channel.
63-
await flutterLocalNotificationsPlugin
64-
.resolvePlatformSpecificImplementation<
65-
AndroidFlutterLocalNotificationsPlugin>()
66-
?.createNotificationChannel(channel);
67-
68-
/// Update the iOS foreground notification presentation options to allow heads up notifications.
69-
await FirebaseMessaging.instance
70-
.setForegroundNotificationPresentationOptions(
71-
alert: true,
72-
badge: true,
73-
sound: true,
74-
);
75-
}
76-
/// Grant entitlements for iOS
77-
if (Platform.isIOS) {
78-
NotificationSettings settings =
79-
await FirebaseMessaging.instance.requestPermission(
80-
announcement: true,
81-
carPlay: true,
82-
criticalAlert: true,
83-
);
84-
85-
if (settings.authorizationStatus == AuthorizationStatus.authorized) {
86-
print('User granted permission');
87-
} else if (settings.authorizationStatus ==
88-
AuthorizationStatus.provisional) {
89-
print('User granted provisional permission');
90-
} else {
91-
print('User declined or has not accepted permission');
92-
}
93-
}
9410

9511
runApp(SampleApp());
9612
}

example/pubspec.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ dependencies:
1313
flutter:
1414
sdk: flutter
1515

16-
firebase_messaging: ^11.0.0
17-
flutter_local_notifications: ^17.2.2
18-
1916
dependency_overrides:
2017
firebase_core_platform_interface: 4.5.1
2118

ios/Classes/SwiftQonversionPlugin.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,20 +319,20 @@ public class SwiftQonversionPlugin: NSObject, FlutterPlugin {
319319
}
320320

321321
private func attachUserToRemoteConfiguration(_ args: [String: Any], _ result: @escaping FlutterResult) {
322-
guard let remoteConfigurationId = args["remoteConfigurationId"] as? String else {
323-
return result(FlutterError.noNecessaryData)
324-
}
325-
326-
qonversionSandwich?.attachUserToRemoteConfiguration(with: remoteConfigurationId, completion: getJsonCompletion(result))
322+
guard let remoteConfigurationId = args["remoteConfigurationId"] as? String else {
323+
return result(FlutterError.noNecessaryData)
327324
}
328325

329-
private func detachUserFromRemoteConfiguration(_ args: [String: Any], _ result: @escaping FlutterResult) {
330-
guard let remoteConfigurationId = args["remoteConfigurationId"] as? String else {
331-
return result(FlutterError.noNecessaryData)
332-
}
326+
qonversionSandwich?.attachUserToRemoteConfiguration(with: remoteConfigurationId, completion: getJsonCompletion(result))
327+
}
333328

334-
qonversionSandwich?.detachUserFromRemoteConfiguration(with: remoteConfigurationId, completion: getJsonCompletion(result))
329+
private func detachUserFromRemoteConfiguration(_ args: [String: Any], _ result: @escaping FlutterResult) {
330+
guard let remoteConfigurationId = args["remoteConfigurationId"] as? String else {
331+
return result(FlutterError.noNecessaryData)
335332
}
333+
334+
qonversionSandwich?.detachUserFromRemoteConfiguration(with: remoteConfigurationId, completion: getJsonCompletion(result))
335+
}
336336

337337
private func storeSdkInfo(_ args: [String: Any], _ result: @escaping FlutterResult) {
338338
guard let version = args["version"] as? String,

ios/qonversion_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
s.source_files = 'Classes/**/*'
1717
s.dependency 'Flutter'
1818
s.platform = :ios, '9.0'
19-
s.dependency "QonversionSandwich", "5.1.4"
19+
s.dependency "QonversionSandwich", "5.1.6"
2020

2121
# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
2222
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }

0 commit comments

Comments
 (0)