ios: add a CallKit icon
The SDK will now search for an asset called "CallKitIcon" on the main bundle, and fallback to a built-in asset it it's not there, allowing SDK users to customize it by just adding asset with that name.
This commit is contained in:
parent
4c286b8580
commit
6bf962817b
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.9 KiB |
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "CallKit@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "CallKit@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "CallKit@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
|
@ -206,14 +206,20 @@ RCT_EXPORT_METHOD(updateCall:(NSString *)callUUID
|
||||||
// iconTemplateImageData
|
// iconTemplateImageData
|
||||||
NSString *iconTemplateImageName = dictionary[@"iconTemplateImageName"];
|
NSString *iconTemplateImageName = dictionary[@"iconTemplateImageName"];
|
||||||
NSData *iconTemplateImageData;
|
NSData *iconTemplateImageData;
|
||||||
|
UIImage *iconTemplateImage;
|
||||||
if (iconTemplateImageName) {
|
if (iconTemplateImageName) {
|
||||||
UIImage *iconTemplateImage
|
// First try to load the resource from the main bundle.
|
||||||
= [UIImage imageNamed:iconTemplateImageName
|
iconTemplateImage = [UIImage imageNamed:iconTemplateImageName];
|
||||||
inBundle:[NSBundle bundleForClass:self.class]
|
|
||||||
compatibleWithTraitCollection:nil];
|
// If that didn't work, use the one built-in.
|
||||||
|
if (!iconTemplateImage) {
|
||||||
|
iconTemplateImage = [UIImage imageNamed:iconTemplateImageName
|
||||||
|
inBundle:[NSBundle bundleForClass:self.class]
|
||||||
|
compatibleWithTraitCollection:nil];
|
||||||
|
}
|
||||||
|
|
||||||
if (iconTemplateImage) {
|
if (iconTemplateImage) {
|
||||||
iconTemplateImageData
|
iconTemplateImageData = UIImagePNGRepresentation(iconTemplateImage);
|
||||||
= UIImagePNGRepresentation(iconTemplateImage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue