@@ -69,6 +69,9 @@ public class SwiftQonversionFlutterSdkPlugin: NSObject, FlutterPlugin {
6969 qonversionSandwich? . logout ( )
7070 return result ( nil )
7171
72+ case " presentCodeRedemptionSheet " :
73+ return presentCodeRedemptionSheet ( result)
74+
7275 default :
7376 break
7477 }
@@ -123,6 +126,9 @@ public class SwiftQonversionFlutterSdkPlugin: NSObject, FlutterPlugin {
123126 case " handleNotification " :
124127 return handleNotification ( args, result)
125128
129+ case " getNotificationCustomPayload " :
130+ return getNotificationCustomPayload ( args, result)
131+
126132 default :
127133 return result ( FlutterMethodNotImplemented)
128134 }
@@ -283,6 +289,22 @@ public class SwiftQonversionFlutterSdkPlugin: NSObject, FlutterPlugin {
283289 result ( isPushHandled)
284290 }
285291
292+ private func getNotificationCustomPayload( _ args: [ AnyHashable : Any ] , _ result: @escaping FlutterResult ) {
293+ guard let notificationData = args [ " notificationData " ] as? [ AnyHashable : Any ] else {
294+ return result ( FlutterError . noData)
295+ }
296+
297+ let customPayload : [ AnyHashable : Any ] ? = qonversionSandwich? . getNotificationCustomPayload ( notificationData)
298+ result ( customPayload? . toJson ( ) )
299+ }
300+
301+ private func presentCodeRedemptionSheet( _ result: @escaping FlutterResult ) {
302+ if #available( iOS 14 . 0 , * ) {
303+ qonversionSandwich? . presentCodeRedemptionSheet ( )
304+ }
305+ result ( nil )
306+ }
307+
286308 private func getDefaultCompletion( _ result: @escaping FlutterResult ) -> BridgeCompletion {
287309 return { data, error in
288310 if let error = error {
0 commit comments