From 20a6a61b455174a6a85d8dc07f29b801ef5ad4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Mon, 9 Oct 2017 15:23:25 -0500 Subject: [PATCH] [iOS] Add icon for CallKit in-call UI --- ios/sdk/sdk.xcodeproj/project.pbxproj | 4 ++++ ios/sdk/src/CallKit.m | 5 ++++- react/features/mobile/callkit/CallKitIcon.png | Bin 0 -> 260 bytes react/features/mobile/callkit/middleware.js | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 react/features/mobile/callkit/CallKitIcon.png diff --git a/ios/sdk/sdk.xcodeproj/project.pbxproj b/ios/sdk/sdk.xcodeproj/project.pbxproj index 1081f7711..6d9712b77 100644 --- a/ios/sdk/sdk.xcodeproj/project.pbxproj +++ b/ios/sdk/sdk.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ 0BA13D311EE83FF8007BEF7F /* ExternalAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BA13D301EE83FF8007BEF7F /* ExternalAPI.m */; }; 0BB9AD7B1F5EC8F4001C08DB /* CallKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BB9AD7A1F5EC8F4001C08DB /* CallKit.m */; }; 0BB9AD7D1F60356D001C08DB /* AppInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BB9AD7C1F60356D001C08DB /* AppInfo.m */; }; + 0BC4B8691F8C03A700CE8B21 /* CallKitIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 0BC4B8681F8C01E100CE8B21 /* CallKitIcon.png */; }; 0BCA495F1EC4B6C600B793EE /* AudioMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495C1EC4B6C600B793EE /* AudioMode.m */; }; 0BCA49601EC4B6C600B793EE /* POSIX.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495D1EC4B6C600B793EE /* POSIX.m */; }; 0BCA49611EC4B6C600B793EE /* Proximity.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495E1EC4B6C600B793EE /* Proximity.m */; }; @@ -35,6 +36,7 @@ 0BA13D301EE83FF8007BEF7F /* ExternalAPI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExternalAPI.m; sourceTree = ""; }; 0BB9AD7A1F5EC8F4001C08DB /* CallKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallKit.m; sourceTree = ""; }; 0BB9AD7C1F60356D001C08DB /* AppInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppInfo.m; sourceTree = ""; }; + 0BC4B8681F8C01E100CE8B21 /* CallKitIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CallKitIcon.png; path = ../../react/features/mobile/callkit/CallKitIcon.png; sourceTree = ""; }; 0BCA495C1EC4B6C600B793EE /* AudioMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioMode.m; sourceTree = ""; }; 0BCA495D1EC4B6C600B793EE /* POSIX.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = POSIX.m; sourceTree = ""; }; 0BCA495E1EC4B6C600B793EE /* Proximity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Proximity.m; sourceTree = ""; }; @@ -63,6 +65,7 @@ 0BCA49681EC4BBE500B793EE /* Resources */ = { isa = PBXGroup; children = ( + 0BC4B8681F8C01E100CE8B21 /* CallKitIcon.png */, 0BCA496B1EC4BBF900B793EE /* jitsi.ttf */, ); name = Resources; @@ -202,6 +205,7 @@ buildActionMask = 2147483647; files = ( 0BCA496C1EC4BBF900B793EE /* jitsi.ttf in Resources */, + 0BC4B8691F8C03A700CE8B21 /* CallKitIcon.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/ios/sdk/src/CallKit.m b/ios/sdk/src/CallKit.m index 63d700bbd..995ec862c 100644 --- a/ios/sdk/src/CallKit.m +++ b/ios/sdk/src/CallKit.m @@ -260,7 +260,10 @@ RCT_EXPORT_METHOD(updateCall:(NSString *)callUUID // iconTemplateImageData NSString *iconTemplateImageName = dictionary[@"iconTemplateImageName"]; if (iconTemplateImageName) { - UIImage *iconTemplateImage = [UIImage imageNamed:iconTemplateImageName]; + UIImage *iconTemplateImage + = [UIImage imageNamed:iconTemplateImageName + inBundle:[NSBundle bundleForClass:self.class] + compatibleWithTraitCollection:nil]; if (iconTemplateImage) { providerConfiguration.iconTemplateImageData = UIImagePNGRepresentation(iconTemplateImage); diff --git a/react/features/mobile/callkit/CallKitIcon.png b/react/features/mobile/callkit/CallKitIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..adefa67d43172fa94c8ae17f7a03a73044356cc3 GIT binary patch literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=3?wxlRx|@CrvRT2S0HUn8L0cjXah7wv?Rzc zn1PF%Ur>C(qQ%QruibL^=(+PZZ#{T)^JQ%eP(h5Ri(`m~_uFo3z6J#m7Do~Ljzhuk z>O()PTugILO5GgnTV{Mr!0ANz9VMm8Evp=_-cFxuHRDLpq$U=nqp0I4?gr v&XqT#ph;KeT~~Lr`95H=@C;{HSf{YlfvDA_Aq$5`njxgN@xNA0x?xC literal 0 HcmV?d00001 diff --git a/react/features/mobile/callkit/middleware.js b/react/features/mobile/callkit/middleware.js index c1dfc3ef0..67900b258 100644 --- a/react/features/mobile/callkit/middleware.js +++ b/react/features/mobile/callkit/middleware.js @@ -83,7 +83,7 @@ function _appWillMount({ dispatch, getState }, next, action) { const result = next(action); CallKit.setProviderConfiguration({ - iconTemplateImageName: 'AppIcon40x40', + iconTemplateImageName: 'CallKitIcon', localizedName: NativeModules.AppInfo.name });