diff --git a/swift/RemoteNotification/Podfile b/swift/RemoteNotification/Podfile new file mode 100644 index 0000000..0049f9d --- /dev/null +++ b/swift/RemoteNotification/Podfile @@ -0,0 +1,24 @@ +# Uncomment the next line to define a global platform for your project +platform :ios, '11.0' +source "https://gitlab.linphone.org/BC/public/podspec.git" +#source "https://github.com/CocoaPods/Specs.git" + +def basic_pods + if ENV['PODFILE_PATH'].nil? + pod 'linphone-sdk', '~> 5.0.0-beta' + else + pod 'linphone-sdk', :path => ENV['PODFILE_PATH'] # local sdk + end + +end + + + +target 'RemoteNotification' do + # Comment the next line if you don't want to use dynamic frameworks + use_frameworks! + + # Pods for RemoteNotification + basic_pods + +end diff --git a/swift/RemoteNotification/RemoteNotification.xcodeproj/project.pbxproj b/swift/RemoteNotification/RemoteNotification.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c846cbd --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification.xcodeproj/project.pbxproj @@ -0,0 +1,801 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXBuildFile section */ + 41160BCD42850AC1D0891474 /* Pods_RemoteNotification.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DE48A29C8F332901C688A73 /* Pods_RemoteNotification.framework */; }; + 6611381D26AEEEB3004BCA9C /* commons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6611381C26AEEEB3004BCA9C /* commons.swift */; }; + 6611382626AEFC88004BCA9C /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6611382526AEFC88004BCA9C /* NotificationService.swift */; }; + 6611382A26AEFC88004BCA9C /* notificationServiceAppExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 6611382326AEFC88004BCA9C /* notificationServiceAppExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 6659236226AB0197007D90EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6659236126AB0197007D90EE /* AppDelegate.swift */; }; + 6659236426AB0197007D90EE /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6659236326AB0197007D90EE /* SceneDelegate.swift */; }; + 6659236626AB0197007D90EE /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6659236526AB0197007D90EE /* ContentView.swift */; }; + 6659236826AB0199007D90EE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6659236726AB0199007D90EE /* Assets.xcassets */; }; + 6659236B26AB0199007D90EE /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6659236A26AB0199007D90EE /* Preview Assets.xcassets */; }; + 6659236E26AB0199007D90EE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6659236C26AB0199007D90EE /* LaunchScreen.storyboard */; }; + 665925C026AEE9FF007D90EE /* RemoteNotificationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 665925BF26AEE9FF007D90EE /* RemoteNotificationExample.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 6611382826AEFC88004BCA9C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6659235626AB0197007D90EE /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6611382226AEFC88004BCA9C; + remoteInfo = notificationServiceAppExtension; + }; + 6659237526AB0199007D90EE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6659235626AB0197007D90EE /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6659235D26AB0197007D90EE; + remoteInfo = RemoteNotification; + }; + 6659238026AB0199007D90EE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6659235626AB0197007D90EE /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6659235D26AB0197007D90EE; + remoteInfo = RemoteNotification; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 6611382E26AEFC88004BCA9C /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 6611382A26AEFC88004BCA9C /* notificationServiceAppExtension.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 6611381C26AEEEB3004BCA9C /* commons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = commons.swift; sourceTree = ""; }; + 6611381E26AEEFA8004BCA9C /* RemoteNotification.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RemoteNotification.entitlements; sourceTree = ""; }; + 6611382326AEFC88004BCA9C /* notificationServiceAppExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = notificationServiceAppExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 6611382526AEFC88004BCA9C /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = ""; }; + 6611382726AEFC88004BCA9C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6659235E26AB0197007D90EE /* RemoteNotification.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RemoteNotification.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6659236126AB0197007D90EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 6659236326AB0197007D90EE /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 6659236526AB0197007D90EE /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 6659236726AB0199007D90EE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6659236A26AB0199007D90EE /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 6659236D26AB0199007D90EE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6659236F26AB0199007D90EE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6659237426AB0199007D90EE /* RemoteNotificationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RemoteNotificationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6659237F26AB0199007D90EE /* RemoteNotificationUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RemoteNotificationUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 665925BF26AEE9FF007D90EE /* RemoteNotificationExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteNotificationExample.swift; sourceTree = ""; }; + 66D473A0C66A9722D7DD956E /* Pods-RemoteNotification.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RemoteNotification.release.xcconfig"; path = "Target Support Files/Pods-RemoteNotification/Pods-RemoteNotification.release.xcconfig"; sourceTree = ""; }; + 8DE48A29C8F332901C688A73 /* Pods_RemoteNotification.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RemoteNotification.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A515A7171F0ECA2A24424178 /* Pods-RemoteNotification.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RemoteNotification.debug.xcconfig"; path = "Target Support Files/Pods-RemoteNotification/Pods-RemoteNotification.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6611382026AEFC88004BCA9C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6659235B26AB0197007D90EE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 41160BCD42850AC1D0891474 /* Pods_RemoteNotification.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6659237126AB0199007D90EE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6659237C26AB0199007D90EE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 004CBACAC0A9258EC1B47E68 /* Pods */ = { + isa = PBXGroup; + children = ( + A515A7171F0ECA2A24424178 /* Pods-RemoteNotification.debug.xcconfig */, + 66D473A0C66A9722D7DD956E /* Pods-RemoteNotification.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + 6611381B26AEEEB3004BCA9C /* TutorialCommons */ = { + isa = PBXGroup; + children = ( + 6611381C26AEEEB3004BCA9C /* commons.swift */, + ); + name = TutorialCommons; + path = ../TutorialCommons; + sourceTree = ""; + }; + 6611382426AEFC88004BCA9C /* notificationServiceAppExtension */ = { + isa = PBXGroup; + children = ( + 6611382526AEFC88004BCA9C /* NotificationService.swift */, + 6611382726AEFC88004BCA9C /* Info.plist */, + ); + path = notificationServiceAppExtension; + sourceTree = ""; + }; + 6659235526AB0197007D90EE = { + isa = PBXGroup; + children = ( + 6611381B26AEEEB3004BCA9C /* TutorialCommons */, + 6659236026AB0197007D90EE /* RemoteNotification */, + 6611382426AEFC88004BCA9C /* notificationServiceAppExtension */, + 6659235F26AB0197007D90EE /* Products */, + 004CBACAC0A9258EC1B47E68 /* Pods */, + F897FB884770B3DFE5695E44 /* Frameworks */, + ); + sourceTree = ""; + }; + 6659235F26AB0197007D90EE /* Products */ = { + isa = PBXGroup; + children = ( + 6659235E26AB0197007D90EE /* RemoteNotification.app */, + 6659237426AB0199007D90EE /* RemoteNotificationTests.xctest */, + 6659237F26AB0199007D90EE /* RemoteNotificationUITests.xctest */, + 6611382326AEFC88004BCA9C /* notificationServiceAppExtension.appex */, + ); + name = Products; + sourceTree = ""; + }; + 6659236026AB0197007D90EE /* RemoteNotification */ = { + isa = PBXGroup; + children = ( + 6611381E26AEEFA8004BCA9C /* RemoteNotification.entitlements */, + 665925BF26AEE9FF007D90EE /* RemoteNotificationExample.swift */, + 6659236126AB0197007D90EE /* AppDelegate.swift */, + 6659236326AB0197007D90EE /* SceneDelegate.swift */, + 6659236526AB0197007D90EE /* ContentView.swift */, + 6659236726AB0199007D90EE /* Assets.xcassets */, + 6659236C26AB0199007D90EE /* LaunchScreen.storyboard */, + 6659236F26AB0199007D90EE /* Info.plist */, + 6659236926AB0199007D90EE /* Preview Content */, + ); + path = RemoteNotification; + sourceTree = ""; + }; + 6659236926AB0199007D90EE /* Preview Content */ = { + isa = PBXGroup; + children = ( + 6659236A26AB0199007D90EE /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + F897FB884770B3DFE5695E44 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8DE48A29C8F332901C688A73 /* Pods_RemoteNotification.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6611382226AEFC88004BCA9C /* notificationServiceAppExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6611382B26AEFC88004BCA9C /* Build configuration list for PBXNativeTarget "notificationServiceAppExtension" */; + buildPhases = ( + 6611381F26AEFC88004BCA9C /* Sources */, + 6611382026AEFC88004BCA9C /* Frameworks */, + 6611382126AEFC88004BCA9C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = notificationServiceAppExtension; + productName = notificationServiceAppExtension; + productReference = 6611382326AEFC88004BCA9C /* notificationServiceAppExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; + 6659235D26AB0197007D90EE /* RemoteNotification */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6659238826AB019A007D90EE /* Build configuration list for PBXNativeTarget "RemoteNotification" */; + buildPhases = ( + EDEC068B598CCB116A697A11 /* [CP] Check Pods Manifest.lock */, + 6659235A26AB0197007D90EE /* Sources */, + 6659235B26AB0197007D90EE /* Frameworks */, + 6659235C26AB0197007D90EE /* Resources */, + 8A6F4F41B2DCEAB2B2C00CF2 /* [CP] Embed Pods Frameworks */, + 6611382E26AEFC88004BCA9C /* Embed App Extensions */, + ); + buildRules = ( + ); + dependencies = ( + 6611382926AEFC88004BCA9C /* PBXTargetDependency */, + ); + name = RemoteNotification; + productName = RemoteNotification; + productReference = 6659235E26AB0197007D90EE /* RemoteNotification.app */; + productType = "com.apple.product-type.application"; + }; + 6659237326AB0199007D90EE /* RemoteNotificationTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6659238B26AB019A007D90EE /* Build configuration list for PBXNativeTarget "RemoteNotificationTests" */; + buildPhases = ( + 6659237026AB0199007D90EE /* Sources */, + 6659237126AB0199007D90EE /* Frameworks */, + 6659237226AB0199007D90EE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6659237626AB0199007D90EE /* PBXTargetDependency */, + ); + name = RemoteNotificationTests; + productName = RemoteNotificationTests; + productReference = 6659237426AB0199007D90EE /* RemoteNotificationTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 6659237E26AB0199007D90EE /* RemoteNotificationUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6659238E26AB019A007D90EE /* Build configuration list for PBXNativeTarget "RemoteNotificationUITests" */; + buildPhases = ( + 6659237B26AB0199007D90EE /* Sources */, + 6659237C26AB0199007D90EE /* Frameworks */, + 6659237D26AB0199007D90EE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6659238126AB0199007D90EE /* PBXTargetDependency */, + ); + name = RemoteNotificationUITests; + productName = RemoteNotificationUITests; + productReference = 6659237F26AB0199007D90EE /* RemoteNotificationUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6659235626AB0197007D90EE /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1250; + LastUpgradeCheck = 1250; + TargetAttributes = { + 6611382226AEFC88004BCA9C = { + CreatedOnToolsVersion = 12.5.1; + }; + 6659235D26AB0197007D90EE = { + CreatedOnToolsVersion = 12.5.1; + }; + 6659237326AB0199007D90EE = { + CreatedOnToolsVersion = 12.5.1; + TestTargetID = 6659235D26AB0197007D90EE; + }; + 6659237E26AB0199007D90EE = { + CreatedOnToolsVersion = 12.5.1; + TestTargetID = 6659235D26AB0197007D90EE; + }; + }; + }; + buildConfigurationList = 6659235926AB0197007D90EE /* Build configuration list for PBXProject "RemoteNotification" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6659235526AB0197007D90EE; + productRefGroup = 6659235F26AB0197007D90EE /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6659235D26AB0197007D90EE /* RemoteNotification */, + 6659237326AB0199007D90EE /* RemoteNotificationTests */, + 6659237E26AB0199007D90EE /* RemoteNotificationUITests */, + 6611382226AEFC88004BCA9C /* notificationServiceAppExtension */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6611382126AEFC88004BCA9C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6659235C26AB0197007D90EE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6659236E26AB0199007D90EE /* LaunchScreen.storyboard in Resources */, + 6659236B26AB0199007D90EE /* Preview Assets.xcassets in Resources */, + 6659236826AB0199007D90EE /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6659237226AB0199007D90EE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6659237D26AB0199007D90EE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 8A6F4F41B2DCEAB2B2C00CF2 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RemoteNotification/Pods-RemoteNotification-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RemoteNotification/Pods-RemoteNotification-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RemoteNotification/Pods-RemoteNotification-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + EDEC068B598CCB116A697A11 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RemoteNotification-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6611381F26AEFC88004BCA9C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6611382626AEFC88004BCA9C /* NotificationService.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6659235A26AB0197007D90EE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6659236226AB0197007D90EE /* AppDelegate.swift in Sources */, + 665925C026AEE9FF007D90EE /* RemoteNotificationExample.swift in Sources */, + 6659236426AB0197007D90EE /* SceneDelegate.swift in Sources */, + 6611381D26AEEEB3004BCA9C /* commons.swift in Sources */, + 6659236626AB0197007D90EE /* ContentView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6659237026AB0199007D90EE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6659237B26AB0199007D90EE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 6611382926AEFC88004BCA9C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6611382226AEFC88004BCA9C /* notificationServiceAppExtension */; + targetProxy = 6611382826AEFC88004BCA9C /* PBXContainerItemProxy */; + }; + 6659237626AB0199007D90EE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6659235D26AB0197007D90EE /* RemoteNotification */; + targetProxy = 6659237526AB0199007D90EE /* PBXContainerItemProxy */; + }; + 6659238126AB0199007D90EE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6659235D26AB0197007D90EE /* RemoteNotification */; + targetProxy = 6659238026AB0199007D90EE /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 6659236C26AB0199007D90EE /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6659236D26AB0199007D90EE /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6611382C26AEFC88004BCA9C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = Z2V957B3D6; + INFOPLIST_FILE = notificationServiceAppExtension/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = org.linphone.tutorials.notification.notificationServiceAppExtension; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6611382D26AEFC88004BCA9C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = Z2V957B3D6; + INFOPLIST_FILE = notificationServiceAppExtension/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = org.linphone.tutorials.notification.notificationServiceAppExtension; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 6659238626AB019A007D90EE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.5; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 6659238726AB019A007D90EE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.5; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6659238926AB019A007D90EE /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A515A7171F0ECA2A24424178 /* Pods-RemoteNotification.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = RemoteNotification/RemoteNotification.entitlements; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"RemoteNotification/Preview Content\""; + DEVELOPMENT_TEAM = Z2V957B3D6; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = RemoteNotification/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = org.linphone.tutorials.notification; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6659238A26AB019A007D90EE /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 66D473A0C66A9722D7DD956E /* Pods-RemoteNotification.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = RemoteNotification/RemoteNotification.entitlements; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"RemoteNotification/Preview Content\""; + DEVELOPMENT_TEAM = Z2V957B3D6; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = RemoteNotification/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = org.linphone.tutorials.notification; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 6659238C26AB019A007D90EE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = Z2V957B3D6; + INFOPLIST_FILE = RemoteNotificationTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = BC.RemoteNotificationTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RemoteNotification.app/RemoteNotification"; + }; + name = Debug; + }; + 6659238D26AB019A007D90EE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = Z2V957B3D6; + INFOPLIST_FILE = RemoteNotificationTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = BC.RemoteNotificationTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RemoteNotification.app/RemoteNotification"; + }; + name = Release; + }; + 6659238F26AB019A007D90EE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = Z2V957B3D6; + INFOPLIST_FILE = RemoteNotificationUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = BC.RemoteNotificationUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = RemoteNotification; + }; + name = Debug; + }; + 6659239026AB019A007D90EE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = Z2V957B3D6; + INFOPLIST_FILE = RemoteNotificationUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = BC.RemoteNotificationUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = RemoteNotification; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6611382B26AEFC88004BCA9C /* Build configuration list for PBXNativeTarget "notificationServiceAppExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6611382C26AEFC88004BCA9C /* Debug */, + 6611382D26AEFC88004BCA9C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6659235926AB0197007D90EE /* Build configuration list for PBXProject "RemoteNotification" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6659238626AB019A007D90EE /* Debug */, + 6659238726AB019A007D90EE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6659238826AB019A007D90EE /* Build configuration list for PBXNativeTarget "RemoteNotification" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6659238926AB019A007D90EE /* Debug */, + 6659238A26AB019A007D90EE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6659238B26AB019A007D90EE /* Build configuration list for PBXNativeTarget "RemoteNotificationTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6659238C26AB019A007D90EE /* Debug */, + 6659238D26AB019A007D90EE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6659238E26AB019A007D90EE /* Build configuration list for PBXNativeTarget "RemoteNotificationUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6659238F26AB019A007D90EE /* Debug */, + 6659239026AB019A007D90EE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6659235626AB0197007D90EE /* Project object */; +} diff --git a/swift/RemoteNotification/RemoteNotification.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/swift/RemoteNotification/RemoteNotification.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/swift/RemoteNotification/RemoteNotification.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/swift/RemoteNotification/RemoteNotification.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/swift/RemoteNotification/RemoteNotification.xcworkspace/contents.xcworkspacedata b/swift/RemoteNotification/RemoteNotification.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..878f3d3 --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/swift/RemoteNotification/RemoteNotification.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/swift/RemoteNotification/RemoteNotification.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/swift/RemoteNotification/RemoteNotification/AppDelegate.swift b/swift/RemoteNotification/RemoteNotification/AppDelegate.swift new file mode 100644 index 0000000..551a302 --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification/AppDelegate.swift @@ -0,0 +1,61 @@ +// +// AppDelegate.swift +// LoginTutorial +// +// Created by QuentinArguillere on 31/07/2020. +// Copyright © 2020 BelledonneCommunications. All rights reserved. +// + +import UIKit +import SwiftUI + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + @ObservedObject var tutorialContext = LoginTutorialContext() + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + registerForPushNotifications() + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + func buildTest(obj: UnsafeRawPointer) { + + } + + func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { + var stringifiedToken = deviceToken.map{String(format: "%02X", $0)}.joined() + stringifiedToken.append(String(":remote")) + tutorialContext.mCore.didRegisterForRemotePushWithStringifiedToken(deviceTokenStr: stringifiedToken) + } + + func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any] + , fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { + + } + func registerForPushNotifications() { + //1 + UNUserNotificationCenter.current() + //2 + .requestAuthorization(options: [.alert, .sound, .badge]) { granted, _ in + //3 + print("Permission granted: \(granted)") + } + } +} + diff --git a/swift/RemoteNotification/RemoteNotification/Assets.xcassets/AccentColor.colorset/Contents.json b/swift/RemoteNotification/RemoteNotification/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/swift/RemoteNotification/RemoteNotification/Assets.xcassets/AppIcon.appiconset/Contents.json b/swift/RemoteNotification/RemoteNotification/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/swift/RemoteNotification/RemoteNotification/Assets.xcassets/Contents.json b/swift/RemoteNotification/RemoteNotification/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/swift/RemoteNotification/RemoteNotification/Base.lproj/LaunchScreen.storyboard b/swift/RemoteNotification/RemoteNotification/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swift/RemoteNotification/RemoteNotification/ContentView.swift b/swift/RemoteNotification/RemoteNotification/ContentView.swift new file mode 100644 index 0000000..a7c2120 --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification/ContentView.swift @@ -0,0 +1,78 @@ +// +// ContentView.swift +// LoginTutorial +// +// Created by QuentinArguillere on 31/07/2020. +// Copyright © 2020 BelledonneCommunications. All rights reserved. +// + +import SwiftUI + +struct ContentView: View { + + @ObservedObject var tutorialContext : LoginTutorialContext + + var body: some View { + + VStack { + Group { + HStack { + Text("Identity :") + .font(.title) + TextField("", text : $tutorialContext.id) + .textFieldStyle(RoundedBorderTextFieldStyle()) + .disabled(tutorialContext.loggedIn) + } + HStack { + Text("Password :") + .font(.title) + TextField("", text : $tutorialContext.passwd) + .textFieldStyle(RoundedBorderTextFieldStyle()) + .disabled(tutorialContext.loggedIn) + } + VStack { + HStack { + Button(action: { + if (self.tutorialContext.loggedIn) + { + self.tutorialContext.logoutExample() + } else { + self.tutorialContext.registrationExample() + } + }) + { + Text(tutorialContext.loggedIn ? "Log out" : "Log in") + .font(.largeTitle) + .foregroundColor(Color.white) + .frame(width: 125.0, height: 42.0) + .background(Color.gray) + } + + } + HStack { + Text("Login State : ") + .font(.footnote) + Text(tutorialContext.loggedIn ? "Looged in" : "Unregistered") + .font(.footnote) + .foregroundColor(tutorialContext.loggedIn ? Color.green : Color.black) + }.padding(.top, 10.0) + } + } + Group { + Spacer() + Toggle(isOn: $tutorialContext.loggingUnit.logsEnabled.value) { + Text("Logs collection") + .multilineTextAlignment(.trailing) + } + Text("Hello, Linphone, Core Version is \n \(tutorialContext.coreVersion)") + } + } + .padding() + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView(tutorialContext: LoginTutorialContext()) + } +} diff --git a/swift/RemoteNotification/RemoteNotification/Info.plist b/swift/RemoteNotification/RemoteNotification/Info.plist new file mode 100644 index 0000000..3984f98 --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification/Info.plist @@ -0,0 +1,68 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + RemoteNotification + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UIApplicationSupportsIndirectInputEvents + + UIBackgroundModes + + remote-notification + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/swift/RemoteNotification/RemoteNotification/Preview Content/Preview Assets.xcassets/Contents.json b/swift/RemoteNotification/RemoteNotification/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/swift/RemoteNotification/RemoteNotification/RemoteNotification.entitlements b/swift/RemoteNotification/RemoteNotification/RemoteNotification.entitlements new file mode 100644 index 0000000..903def2 --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification/RemoteNotification.entitlements @@ -0,0 +1,8 @@ + + + + + aps-environment + development + + diff --git a/swift/RemoteNotification/RemoteNotification/RemoteNotificationExample.swift b/swift/RemoteNotification/RemoteNotification/RemoteNotificationExample.swift new file mode 100644 index 0000000..a8d8623 --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification/RemoteNotificationExample.swift @@ -0,0 +1,87 @@ +// +// LoginExample.swift +// LoginTutorial +// +// Created by QuentinArguillere on 31/07/2020. +// Copyright © 2020 BelledonneCommunications. All rights reserved. +// + +import linphonesw + +class LoginTutorialContext : ObservableObject +{ + var mCore: Core! // We need a Core for... anything, basically + @Published var coreVersion: String = Core.getVersion + + /*------------ Logs related variables ------------------------*/ + var loggingUnit = LoggingUnit() + + /*------------ Login tutorial related variables -------*/ + var account: Account? + var mRegistrationDelegate : CoreDelegate! + @Published var id : String = "sip:quentindev@sip.linphone.org" + @Published var passwd : String = "dev" + @Published var loggedIn: Bool = false + + + init() + { + // Initialize Linphone Core + try? mCore = Factory.Instance.createCore(configPath: "", factoryConfigPath: "", systemContext: nil) + + // main loop for receiving notifications and doing background linphonecore work: + mCore.pushNotificationEnabled = true + mCore.autoIterateEnabled = true + + try? mCore.start() + + // Add callbacks to the Linphone Core + mRegistrationDelegate = CoreDelegateStub(onAccountRegistrationStateChanged: { (core: Core, account: Account, state: RegistrationState, message: String) in + print("New registration state \(state) for user id \( String(describing: account.params?.identityAddress?.asString()))\n") + if (state == .Ok) { + self.loggedIn = true + } else if (state == .Cleared) { + self.loggedIn = false + } + let test = account.params + print("Trace -- remotetoken \(account.params?.pushNotificationConfig?.remoteToken)") + }) + mCore.addDelegate(delegate: mRegistrationDelegate) + } + + func registrationExample() + { + if (!loggedIn) { + do { + if (account == nil) { + account = try createAndInitializeAccount(core : mCore, identity: id, password: passwd) + + let params = account!.params!.clone()! + params.remotePushNotificationAllowed = true + account!.params = params + + try mCore.addAccount(account: account!) + if ( mCore.defaultAccount == nil) { + // IMPORTANT : default account setting MUST be done AFTER adding the config to the core !) + mCore.defaultAccount = account + } + } + else { + let registeredParams = account?.params?.clone() + registeredParams?.registerEnabled = false + account?.params = registeredParams + } + } catch { print(error) } + } + } + + func logoutExample() + { + if (loggedIn) { + let unregisteredParams = account?.params?.clone() + unregisteredParams?.registerEnabled = false + account?.params = unregisteredParams + } + } + +} diff --git a/swift/RemoteNotification/RemoteNotification/SceneDelegate.swift b/swift/RemoteNotification/RemoteNotification/SceneDelegate.swift new file mode 100644 index 0000000..fb79271 --- /dev/null +++ b/swift/RemoteNotification/RemoteNotification/SceneDelegate.swift @@ -0,0 +1,65 @@ +// +// SceneDelegate.swift +// LoginTutorial +// +// Created by QuentinArguillere on 31/07/2020. +// Copyright © 2020 BelledonneCommunications. All rights reserved. +// + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + let delegate = UIApplication.shared.delegate as! AppDelegate + + // Create the SwiftUI view that provides the window contents. + let contentView = ContentView(tutorialContext: delegate.tutorialContext) + + // Use a UIHostingController as window root view controller. + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: contentView) + self.window = window + window.makeKeyAndVisible() + } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/swift/RemoteNotification/notificationServiceAppExtension/Info.plist b/swift/RemoteNotification/notificationServiceAppExtension/Info.plist new file mode 100644 index 0000000..22538d4 --- /dev/null +++ b/swift/RemoteNotification/notificationServiceAppExtension/Info.plist @@ -0,0 +1,31 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + notificationServiceAppExtension + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + NSExtension + + NSExtensionPointIdentifier + com.apple.usernotifications.service + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).NotificationService + + + diff --git a/swift/RemoteNotification/notificationServiceAppExtension/NotificationService.swift b/swift/RemoteNotification/notificationServiceAppExtension/NotificationService.swift new file mode 100644 index 0000000..1748e15 --- /dev/null +++ b/swift/RemoteNotification/notificationServiceAppExtension/NotificationService.swift @@ -0,0 +1,35 @@ +// +// NotificationService.swift +// notificationServiceAppExtension +// +// Created by QuentinArguillere on 26/07/2021. +// + +import UserNotifications + +class NotificationService: UNNotificationServiceExtension { + + var contentHandler: ((UNNotificationContent) -> Void)? + var bestAttemptContent: UNMutableNotificationContent? + + override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { + self.contentHandler = contentHandler + bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) + + if let bestAttemptContent = bestAttemptContent { + // Modify the notification content here... + bestAttemptContent.title = "\(bestAttemptContent.title) [modified]" + + contentHandler(bestAttemptContent) + } + } + + override func serviceExtensionTimeWillExpire() { + // Called just before the extension will be terminated by the system. + // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. + if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { + contentHandler(bestAttemptContent) + } + } + +}