From b10d16e5c5f9e52e20b3b60607ed5f72892c0845 Mon Sep 17 00:00:00 2001 From: sonerdm Date: Fri, 17 Jun 2022 16:22:40 +0300 Subject: [PATCH] demo update --- InsiderDemo/InsiderDemo/AppDelegate.swift | 22 +++++++++---------- InsiderDemo/InsiderDemo/Info.plist | 8 ------- .../InsiderDemo/InsiderDemo.entitlements | 4 +--- .../InsiderNotificationContent.entitlements | 4 +--- .../InsiderNotificationService.entitlements | 4 +--- 5 files changed, 14 insertions(+), 28 deletions(-) diff --git a/InsiderDemo/InsiderDemo/AppDelegate.swift b/InsiderDemo/InsiderDemo/AppDelegate.swift index 5933f0f..05ec9c1 100644 --- a/InsiderDemo/InsiderDemo/AppDelegate.swift +++ b/InsiderDemo/InsiderDemo/AppDelegate.swift @@ -29,6 +29,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD UNUserNotificationCenter.current().delegate = self Insider.initWithLaunchOptions(launchOptions, partnerName: INSIDER_PARTNER_NAME, appGroup: APP_GROUP) + Insider.setActiveForegroundPushView() Insider.register(withQuietPermission: false) Insider.registerCallback(with: #selector(insiderCallbackHandler(info:)), sender: self) Insider.enableIDFACollection(false); @@ -43,29 +44,28 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD return true } + func showAlertAction(title: String, message: String){ + let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert) + alert.addAction(UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler: nil)) + self.window?.rootViewController?.present(alert, animated: true, completion: nil) + } + @objc func insiderCallbackHandler(info: [String : AnyObject]){ let type = info["type"]?.intValue ?? -1 switch type { case InsiderCallbackType.notificationOpen.rawValue: print(info) - break - case InsiderCallbackType.inappButtonClick.rawValue: - print(info) - break - case InsiderCallbackType.tempStorePurchase.rawValue: - print(info) - break - case InsiderCallbackType.tempStoreAddedToCart.rawValue: - print(info) + let callback = String(describing: info) + showAlertAction(title: "InsiderCallbackTypeNotificationOpen", message: callback) break case InsiderCallbackType.tempStoreCustomAction.rawValue: print(info) + let callback = String(describing: info) + showAlertAction(title: "InsiderCallbackTypeTempStoreCustomAction", message: callback) break default: print(info) break } } - } - diff --git a/InsiderDemo/InsiderDemo/Info.plist b/InsiderDemo/InsiderDemo/Info.plist index 15fa3ea..2f6c4b4 100644 --- a/InsiderDemo/InsiderDemo/Info.plist +++ b/InsiderDemo/InsiderDemo/Info.plist @@ -26,14 +26,6 @@ insideryour_partner_name - - CFBundleTypeRole - Editor - CFBundleURLSchemes - - insiderqaautomation1 - - CFBundleVersion 1 diff --git a/InsiderDemo/InsiderDemo/InsiderDemo.entitlements b/InsiderDemo/InsiderDemo/InsiderDemo.entitlements index ff6c9b3..127fede 100644 --- a/InsiderDemo/InsiderDemo/InsiderDemo.entitlements +++ b/InsiderDemo/InsiderDemo/InsiderDemo.entitlements @@ -5,8 +5,6 @@ aps-environment development com.apple.security.application-groups - - group.com.useinsider.InsiderDemo - + diff --git a/InsiderDemo/InsiderNotificationContent/InsiderNotificationContent.entitlements b/InsiderDemo/InsiderNotificationContent/InsiderNotificationContent.entitlements index 5f8a375..2eb7e33 100644 --- a/InsiderDemo/InsiderNotificationContent/InsiderNotificationContent.entitlements +++ b/InsiderDemo/InsiderNotificationContent/InsiderNotificationContent.entitlements @@ -3,8 +3,6 @@ com.apple.security.application-groups - - group.com.useinsider.InsiderDemo - + diff --git a/InsiderDemo/InsiderNotificationService/InsiderNotificationService.entitlements b/InsiderDemo/InsiderNotificationService/InsiderNotificationService.entitlements index 5f8a375..2eb7e33 100644 --- a/InsiderDemo/InsiderNotificationService/InsiderNotificationService.entitlements +++ b/InsiderDemo/InsiderNotificationService/InsiderNotificationService.entitlements @@ -3,8 +3,6 @@ com.apple.security.application-groups - - group.com.useinsider.InsiderDemo - +