Add RemoteNotification tutorial

This commit is contained in:
QuentinArguillere
2021-07-29 11:42:54 +02:00
parent d064fb5712
commit 3f09bddbf5
19 changed files with 1441 additions and 0 deletions

View File

@@ -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

View File

@@ -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 = "<group>"; };
6611381E26AEEFA8004BCA9C /* RemoteNotification.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RemoteNotification.entitlements; sourceTree = "<group>"; };
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 = "<group>"; };
6611382726AEFC88004BCA9C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
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 = "<group>"; };
6659236326AB0197007D90EE /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
6659236526AB0197007D90EE /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
6659236726AB0199007D90EE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
6659236A26AB0199007D90EE /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
6659236D26AB0199007D90EE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6659236F26AB0199007D90EE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
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 = "<group>"; };
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 = "<group>"; };
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 = "<group>"; };
/* 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 = "<group>";
};
6611381B26AEEEB3004BCA9C /* TutorialCommons */ = {
isa = PBXGroup;
children = (
6611381C26AEEEB3004BCA9C /* commons.swift */,
);
name = TutorialCommons;
path = ../TutorialCommons;
sourceTree = "<group>";
};
6611382426AEFC88004BCA9C /* notificationServiceAppExtension */ = {
isa = PBXGroup;
children = (
6611382526AEFC88004BCA9C /* NotificationService.swift */,
6611382726AEFC88004BCA9C /* Info.plist */,
);
path = notificationServiceAppExtension;
sourceTree = "<group>";
};
6659235526AB0197007D90EE = {
isa = PBXGroup;
children = (
6611381B26AEEEB3004BCA9C /* TutorialCommons */,
6659236026AB0197007D90EE /* RemoteNotification */,
6611382426AEFC88004BCA9C /* notificationServiceAppExtension */,
6659235F26AB0197007D90EE /* Products */,
004CBACAC0A9258EC1B47E68 /* Pods */,
F897FB884770B3DFE5695E44 /* Frameworks */,
);
sourceTree = "<group>";
};
6659235F26AB0197007D90EE /* Products */ = {
isa = PBXGroup;
children = (
6659235E26AB0197007D90EE /* RemoteNotification.app */,
6659237426AB0199007D90EE /* RemoteNotificationTests.xctest */,
6659237F26AB0199007D90EE /* RemoteNotificationUITests.xctest */,
6611382326AEFC88004BCA9C /* notificationServiceAppExtension.appex */,
);
name = Products;
sourceTree = "<group>";
};
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 = "<group>";
};
6659236926AB0199007D90EE /* Preview Content */ = {
isa = PBXGroup;
children = (
6659236A26AB0199007D90EE /* Preview Assets.xcassets */,
);
path = "Preview Content";
sourceTree = "<group>";
};
F897FB884770B3DFE5695E44 /* Frameworks */ = {
isa = PBXGroup;
children = (
8DE48A29C8F332901C688A73 /* Pods_RemoteNotification.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* 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 = "<group>";
};
/* 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 */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:RemoteNotification.xcodeproj">
</FileRef>
<Group
location = "container:"
name = "New Group">
</Group>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@@ -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<UISceneSession>) {
// 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)")
}
}
}

View File

@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -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
}
}

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

View File

@@ -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())
}
}

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>RemoteNotification</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>

View File

@@ -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
}
}
}

View File

@@ -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.
}
}

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>notificationServiceAppExtension</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.usernotifications.service</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).NotificationService</string>
</dict>
</dict>
</plist>

View File

@@ -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)
}
}
}