@robono/calling-react-native 0.11.0 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.2
4
+
5
+ - Automatically bundle the website’s downloaded `.robono/callkit-icon.json` during iPhone builds. Explicit `callKitIcon` options take precedence. An exported removal restores the default on rebuild. Android setup is unchanged.
6
+
7
+ ## 0.11.1
8
+
9
+ - Allow each host to supply a bundled CallKit template icon with the Expo plugin's `callKitIcon` PNG path or the native `RobonoCallKitIconName` Info.plist entry.
10
+ - Apply `CXProviderConfiguration.iconTemplateImageData` before creating CallKit, including native startup from a VoIP push while locked, without requiring JavaScript initialization.
11
+ - Validate and bundle Expo icons in the main application target without duplicate resources. Android branding is unchanged.
12
+
13
+
3
14
  ## 0.11.0 — 2026-11-10
4
15
 
5
16
  Add shared phrase-analysis request, participant consent and active notices on iPhone, Android and web.
package/INCOMING-CALLS.md CHANGED
@@ -37,6 +37,48 @@ cached contact name displays “Incoming call”; the push contains no contact p
37
37
  Android’s incoming screen reuses the saved calling colors and button labels from Features & preview. Apple controls the language and layout of its system screen. The connected call uses the supplied Messenger call screen and feature choices.
38
38
  Calls answered elsewhere close the other devices' invitations.
39
39
 
40
+ ### Your bundled CallKit icon
41
+
42
+ Supply a local template PNG in the calling Expo plugin:
43
+
44
+ ```json
45
+ {
46
+ "plugins": [
47
+ ["@robono/calling-react-native", {
48
+ "callKitIcon": "./assets/callkit-icon.png"
49
+ }]
50
+ ]
51
+ }
52
+ ```
53
+
54
+ Rebuild the iPhone application after adding or changing the icon. The plugin
55
+ validates and copies the PNG into the application target's resources and sets
56
+ `RobonoCallKitIconName` in Info.plist. Use a square 40, 80, or 120 pixel PNG for
57
+ the 40-point icon, with the shape in its alpha channel and transparent space
58
+ around it. Apple uses the alpha channel as a template mask; a full-color app
59
+ icon with an opaque background usually produces a solid square. See Apple's
60
+ [iconTemplateImageData requirements](https://developer.apple.com/documentation/callkit/cxproviderconfiguration/icontemplateimagedata).
61
+
62
+ The native coordinator loads the bundled image and assigns
63
+ `CXProviderConfiguration.iconTemplateImageData` **before** creating its
64
+ `CXProvider`. The same path runs when a VoIP push launches the app while locked,
65
+ before React starts. There is no downloaded image, JavaScript callback, or
66
+ previous foreground-session requirement for loading this icon. Apple controls
67
+ where its system interface displays the template; it is not a replacement for
68
+ the caller's photo or your app's home-screen icon.
69
+
70
+ For bare React Native, add the PNG to the application's Copy Bundle Resources,
71
+ or add a template image to the application's asset catalog. Set
72
+ `RobonoCallKitIconName` to that resource filename (for example,
73
+ `CompanyCallKit.png`) or asset name (`CompanyCallKit`). No JavaScript setting is
74
+ required. A missing or invalid native resource is logged and calling continues
75
+ with Apple's default appearance.
76
+
77
+ Omitting `callKitIcon` preserves any manually configured Info.plist asset name.
78
+ Use `callKitIcon: null` to remove the generated setting. This is an iOS option;
79
+ Android keeps its existing app and notification branding. It does not change
80
+ incoming-call registration, account authorization, or notification delivery.
81
+
40
82
  Do Not Disturb, force-stop, notification settings and platform restrictions still
41
83
  apply. Android full-screen intents require the user's permission and Google Play
42
84
  eligibility for calling apps; otherwise the call notification offers the controls.
@@ -66,3 +108,9 @@ Configure it with the authenticated notification `accountScope`, connect each
66
108
  controller with `attach`, pass `audio` to the native media adapter, and register
67
109
  its notification fields with the normal device. Clear it before changing accounts.
68
110
  Never construct account scopes from unverified notification contents.
111
+
112
+ ### Website icon setup (0.11.2+)
113
+
114
+ In the website designer, choose a calling screen and **iPhone call icon**. Upload a transparent PNG, save the design, and download the icon setup. Put the file at `.robono/callkit-icon.json` in the app project and rebuild iOS. The calling Expo plugin (also included by the Messenger setup plugin) reads this self-contained file during the native build and bundles the image; no network download or JavaScript startup is needed for locked incoming calls. Apple controls the icon’s placement and tint. Android calling is unchanged.
115
+
116
+ The JSON format is `{ "format": "robono-callkit-icon", "version": 1, "pngBase64": "…" }`. The website produces a 120×120 PNG alpha mask, up to 64 KiB. To remove it, download the setup again after choosing Remove icon; its `pngBase64` is `null`. Keep that removal file through the next native build. Deleting the file alone preserves manually configured native settings. An explicit `callKitIcon` plugin option overrides the downloaded setup; remove that option to use website branding. Bare native projects should use the bundled asset instructions above. Saving or applying website designs cannot update icons already installed on phones.
package/README.md CHANGED
@@ -27,7 +27,7 @@ Installing the engine never installs or opens these screens. Importing this pack
27
27
  Install the versioned calling engine and the optional mobile package from npm:
28
28
 
29
29
  ```sh
30
- npm install @robono/calling@0.1.2 @robono/calling-react-native@0.2.1
30
+ npm install @robono/calling@0.7.0 @robono/calling-react-native@0.11.2
31
31
  ```
32
32
  The screens need React, React Native, React Native SVG and Safe Area Context 5. The native audio and notification adapters support the following Expo dependency families:
33
33
 
package/SBOM.spdx.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "spdxVersion": "SPDX-2.3",
3
3
  "dataLicense": "CC0-1.0",
4
4
  "SPDXID": "SPDXRef-DOCUMENT",
5
- "name": "@robono/calling-react-native@0.11.0",
6
- "documentNamespace": "https://robono.com/sbom/calling-react-native/0.11.0/b5f98ab3da628f618fe82cd5b31ea6b442145952",
5
+ "name": "@robono/calling-react-native@0.11.2",
6
+ "documentNamespace": "https://robono.com/sbom/calling-react-native/0.11.2/bc0725aa08c93895cc686b95ae563fc3610b565c",
7
7
  "creationInfo": {
8
- "created": "2026-11-10T12:10:19.103Z",
8
+ "created": "2026-11-16T09:56:20.575Z",
9
9
  "creators": [
10
10
  "Organization: Robono (support@robono.com)"
11
11
  ]
@@ -14,11 +14,11 @@
14
14
  {
15
15
  "name": "@robono/calling-react-native",
16
16
  "SPDXID": "SPDXRef-Package",
17
- "versionInfo": "0.11.0",
17
+ "versionInfo": "0.11.2",
18
18
  "downloadLocation": "NOASSERTION",
19
19
  "filesAnalyzed": true,
20
20
  "packageVerificationCode": {
21
- "packageVerificationCodeValue": "b5f98ab3da628f618fe82cd5b31ea6b442145952"
21
+ "packageVerificationCodeValue": "bc0725aa08c93895cc686b95ae563fc3610b565c"
22
22
  },
23
23
  "licenseConcluded": "LicenseRef-RobonoSDK",
24
24
  "licenseDeclared": "LicenseRef-RobonoSDK",
@@ -36,11 +36,11 @@
36
36
  "checksums": [
37
37
  {
38
38
  "algorithm": "SHA256",
39
- "checksumValue": "60f7eafb47abdcae4a13bfc3859a4ed6fab92e9b1c481dd9940706c8603f78d4"
39
+ "checksumValue": "77cabf8d28e04dab5d1e023710fc53e6003d3d1673ee8fd637b5550ffbd51e67"
40
40
  },
41
41
  {
42
42
  "algorithm": "SHA1",
43
- "checksumValue": "86db9172ed8da50a8d691676bbfa9843e6d37137"
43
+ "checksumValue": "d86eaafb4692a281920182694004d3db42491e23"
44
44
  }
45
45
  ],
46
46
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -55,11 +55,11 @@
55
55
  "checksums": [
56
56
  {
57
57
  "algorithm": "SHA256",
58
- "checksumValue": "ca412be2b388aef60c422f8a8a979e89e1d8a3228abaee32fe63dfb49b69469e"
58
+ "checksumValue": "5694d58841375eca4b45fbcbf97b51328f1a32f17ebe21754c3863d079af74c0"
59
59
  },
60
60
  {
61
61
  "algorithm": "SHA1",
62
- "checksumValue": "6fabff1358efdfc665b8516df3cc81784e0f0b37"
62
+ "checksumValue": "096a288bcc657cf40695098927d887ceeb2dd648"
63
63
  }
64
64
  ],
65
65
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -93,11 +93,11 @@
93
93
  "checksums": [
94
94
  {
95
95
  "algorithm": "SHA256",
96
- "checksumValue": "1ebb385fcc01f891e5678cad5c5343d7fa7cc32f66fe992776e2b526d94b19f0"
96
+ "checksumValue": "ae12a3c0581552dcbbdb2fd6fa7977f256548e12f374343a59fb1b1060c8bc56"
97
97
  },
98
98
  {
99
99
  "algorithm": "SHA1",
100
- "checksumValue": "ec8bd8b69372828e9272b88c35a4093b9593301c"
100
+ "checksumValue": "856c29bb9f3888bd19a9c19ba3116e4bdccbc61b"
101
101
  }
102
102
  ],
103
103
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -416,11 +416,11 @@
416
416
  "checksums": [
417
417
  {
418
418
  "algorithm": "SHA256",
419
- "checksumValue": "25191a9348150d9e9396b6e8948c0f64c14676d0f897d07c76412477d0fe8f76"
419
+ "checksumValue": "d60e063d519e02131f61baebd5d27432a4de537bbfc493d3e8d5697b7373652b"
420
420
  },
421
421
  {
422
422
  "algorithm": "SHA1",
423
- "checksumValue": "e74f4aa5d5aacba419ac6a5fd1bed82c56670d0b"
423
+ "checksumValue": "63dc507a0d0706511d20c386c68e7d409282ad6a"
424
424
  }
425
425
  ],
426
426
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -6211,11 +6211,11 @@
6211
6211
  "checksums": [
6212
6212
  {
6213
6213
  "algorithm": "SHA256",
6214
- "checksumValue": "3803d3886d42b1b837085c84e489bed3507c231f1ca76f76ea52ea91e63b44fc"
6214
+ "checksumValue": "457beb3bb05f9aeea96ef0e5f8cfb008c094ccd812984ac821e01746134603b5"
6215
6215
  },
6216
6216
  {
6217
6217
  "algorithm": "SHA1",
6218
- "checksumValue": "a3e8045cb0708ec094deb2a30e7c155fc9cc5b98"
6218
+ "checksumValue": "517c8863d613d213b5f935bcd586195441342d43"
6219
6219
  }
6220
6220
  ],
6221
6221
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -6230,11 +6230,11 @@
6230
6230
  "checksums": [
6231
6231
  {
6232
6232
  "algorithm": "SHA256",
6233
- "checksumValue": "937bcb89a225c13c68f79b5de799cdad976a3ba992f6d7e87aa51f3ade077f49"
6233
+ "checksumValue": "260316fbe426908336927309d20c46cf126145625cc74f4c97352b0ef5366437"
6234
6234
  },
6235
6235
  {
6236
6236
  "algorithm": "SHA1",
6237
- "checksumValue": "564c4b1fbffb180bbfa00cd3cc1deee18b29bf42"
6237
+ "checksumValue": "42e574aa7d07417907f145ae73a0294b21c0821d"
6238
6238
  }
6239
6239
  ],
6240
6240
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -6496,11 +6496,11 @@
6496
6496
  "checksums": [
6497
6497
  {
6498
6498
  "algorithm": "SHA256",
6499
- "checksumValue": "32bc41a29950ad9c4a61c602d2469a937394d941ffd10f154ffcbdd84a764009"
6499
+ "checksumValue": "ac4c82483ef4635ef72f451a4c4dd4e5655fe01d7ec7662b21921e6867efc0f7"
6500
6500
  },
6501
6501
  {
6502
6502
  "algorithm": "SHA1",
6503
- "checksumValue": "9a6d8e8011028022dc54ec99babb581b531630db"
6503
+ "checksumValue": "95f4be3d65b5c60fe5e16b448572ec68db7ca6e6"
6504
6504
  }
6505
6505
  ],
6506
6506
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -6591,11 +6591,11 @@
6591
6591
  "checksums": [
6592
6592
  {
6593
6593
  "algorithm": "SHA256",
6594
- "checksumValue": "af364a58369910059a1d5c73be224f5479b6fb85101b3e14428f883934a2511c"
6594
+ "checksumValue": "9e8b9dbd173279dbab4b2fcc3ec093da8aa5992deb33a2bb7f04dcd72501f401"
6595
6595
  },
6596
6596
  {
6597
6597
  "algorithm": "SHA1",
6598
- "checksumValue": "3f40d3b47543c77be5766ae3a1a635d21de6c179"
6598
+ "checksumValue": "d3012707f2ebe4a2f7f05e4480c712c382b86802"
6599
6599
  }
6600
6600
  ],
6601
6601
  "licenseConcluded": "LicenseRef-RobonoSDK",
@@ -6605,8 +6605,27 @@
6605
6605
  "copyrightText": "Copyright (c) 2026 Add to Loop LLC."
6606
6606
  },
6607
6607
  {
6608
- "fileName": "./plugin/incoming-calls.cjs",
6608
+ "fileName": "./plugin/callkit-icon.cjs",
6609
6609
  "SPDXID": "SPDXRef-File-346",
6610
+ "checksums": [
6611
+ {
6612
+ "algorithm": "SHA256",
6613
+ "checksumValue": "67582b47c123a87856af6acbca9a1b995ee1c6abd0608caf73fc3bdf28c0fdb0"
6614
+ },
6615
+ {
6616
+ "algorithm": "SHA1",
6617
+ "checksumValue": "31c50f5cd98e41e2492a6cd1812c5d91bcb4db6f"
6618
+ }
6619
+ ],
6620
+ "licenseConcluded": "LicenseRef-RobonoSDK",
6621
+ "licenseInfoInFiles": [
6622
+ "LicenseRef-RobonoSDK"
6623
+ ],
6624
+ "copyrightText": "Copyright (c) 2026 Add to Loop LLC."
6625
+ },
6626
+ {
6627
+ "fileName": "./plugin/incoming-calls.cjs",
6628
+ "SPDXID": "SPDXRef-File-347",
6610
6629
  "checksums": [
6611
6630
  {
6612
6631
  "algorithm": "SHA256",
@@ -6625,7 +6644,7 @@
6625
6644
  },
6626
6645
  {
6627
6646
  "fileName": "./plugin/picture-in-picture.cjs",
6628
- "SPDXID": "SPDXRef-File-347",
6647
+ "SPDXID": "SPDXRef-File-348",
6629
6648
  "checksums": [
6630
6649
  {
6631
6650
  "algorithm": "SHA256",
@@ -6644,7 +6663,7 @@
6644
6663
  },
6645
6664
  {
6646
6665
  "fileName": "./plugin/screensharing.cjs",
6647
- "SPDXID": "SPDXRef-File-348",
6666
+ "SPDXID": "SPDXRef-File-349",
6648
6667
  "checksums": [
6649
6668
  {
6650
6669
  "algorithm": "SHA256",
@@ -6663,7 +6682,7 @@
6663
6682
  },
6664
6683
  {
6665
6684
  "fileName": "./react-native.config.js",
6666
- "SPDXID": "SPDXRef-File-349",
6685
+ "SPDXID": "SPDXRef-File-350",
6667
6686
  "checksums": [
6668
6687
  {
6669
6688
  "algorithm": "SHA256",
@@ -8436,6 +8455,11 @@
8436
8455
  "spdxElementId": "SPDXRef-Package",
8437
8456
  "relationshipType": "CONTAINS",
8438
8457
  "relatedSpdxElement": "SPDXRef-File-349"
8458
+ },
8459
+ {
8460
+ "spdxElementId": "SPDXRef-Package",
8461
+ "relationshipType": "CONTAINS",
8462
+ "relatedSpdxElement": "SPDXRef-File-350"
8439
8463
  }
8440
8464
  ],
8441
8465
  "hasExtractedLicensingInfos": [
package/app.plugin.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  const {withInfoPlist, withAndroidManifest, createRunOncePlugin} = require('expo/config-plugins');
2
2
  function withCallingRuntime(config, options = {}) {
3
+ config=require('./plugin/callkit-icon.cjs').withCallKitIcon(config,options.callKitIcon);
3
4
  if(options.video&&options.pictureInPicture!==false)config=require('./plugin/picture-in-picture.cjs').withCallPictureInPicture(config);
4
5
  if(options.incomingCalls!==false)config=require('./plugin/incoming-calls.cjs').withIncomingCalls(config);
5
6
  if(options.screenSharing)config=require('./plugin/screensharing.cjs').withScreenSharing(config,typeof options.screenSharing==='object'?options.screenSharing:{});
@@ -1,2 +1,2 @@
1
- export declare const mobileVersion = "0.11.0";
1
+ export declare const mobileVersion = "0.11.2";
2
2
  export declare const engineVersion = "0.7.0";
package/dist/versions.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Generated from the package manifests by build.mjs.
2
- export const mobileVersion = "0.11.0";
2
+ export const mobileVersion = "0.11.2";
3
3
  export const engineVersion = "0.7.0";
@@ -10,6 +10,19 @@
10
10
  static NSString *const Changed = @"RobonoSystemCallingChanged";
11
11
  static NSString *const AccountKey = @"robono.sdk.calls.account.v1";
12
12
  static NSString *const NamesKey = @"robono.sdk.calls.names.v1";
13
+ // Read only signed, bundled resources. This runs before React or a host session
14
+ // is restored, including a launch caused by a VoIP push while locked.
15
+ static NSData *RobonoCallKitIconData(void) {
16
+ NSBundle *bundle=NSBundle.mainBundle;
17
+ id value=[bundle objectForInfoDictionaryKey:@"RobonoCallKitIconName"];
18
+ if(![value isKindOfClass:NSString.class]||![value length])return nil;
19
+ UIImage *icon=[UIImage imageNamed:value inBundle:bundle compatibleWithTraitCollection:nil];
20
+ if(!icon||icon.size.width<=0||icon.size.width!=icon.size.height){
21
+ NSLog(@"Robono calling: the configured CallKit template icon is missing or is not square. Check the bundled resource and RobonoCallKitIconName.");
22
+ return nil;
23
+ }
24
+ return UIImagePNGRepresentation(icon);
25
+ }
13
26
  // WebRTC remains an optional peer for customers using only the screen components.
14
27
  static id RTCSession(void) {
15
28
  Class c=NSClassFromString(@"RTCAudioSession");
@@ -42,6 +55,7 @@ static void RTCAudio(NSString *selector,AVAudioSession *audio){id s=RTCSession()
42
55
  if(self.started||!self.enabled)return;self.started=YES;
43
56
  NSString *name=[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]?:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]?:@"Calls";
44
57
  CXProviderConfiguration *config=[[CXProviderConfiguration alloc] initWithLocalizedName:name];
58
+ config.iconTemplateImageData=RobonoCallKitIconData();
45
59
  config.supportsVideo=YES;config.maximumCallGroups=1;config.maximumCallsPerCallGroup=1;config.supportedHandleTypes=[NSSet setWithObject:@(CXHandleTypeGeneric)];config.includesCallsInRecents=NO;
46
60
  self.provider=[[CXProvider alloc] initWithConfiguration:config];[self.provider setDelegate:self queue:dispatch_get_main_queue()];self.controller=[CXCallController new];
47
61
  if(self.account.length)[self registerPush];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robono/calling-react-native",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "Optional branded calling screens, sounds and native audio adapters for Robono calling.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -0,0 +1,67 @@
1
+ const fs=require('node:fs');
2
+ const path=require('node:path');
3
+ const {withInfoPlist,withXcodeProject,IOSConfig}=require('expo/config-plugins');
4
+ const resource='RobonoCallKitIcon.png';
5
+ const plistKey='RobonoCallKitIconName';
6
+
7
+ function readIcon(projectRoot,input){
8
+ if(typeof input!=='string'||!input.trim()||/^[a-z]+:\/\//i.test(input))throw Error('callKitIcon must be a local PNG file path.');
9
+ const file=path.resolve(projectRoot,input);
10
+ if(!fs.existsSync(file)||!fs.statSync(file).isFile())throw Error('The callKitIcon PNG file does not exist: '+input);
11
+ if(fs.statSync(file).size>1024*1024)throw Error('The callKitIcon PNG must be smaller than 1 MiB.');
12
+ return validateIcon(fs.readFileSync(file));
13
+ }
14
+ function validateIcon(data){
15
+ if(data.length<33||!data.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10]))||data.toString('ascii',12,16)!=='IHDR')throw Error('callKitIcon must be a PNG image.');
16
+ const width=data.readUInt32BE(16),height=data.readUInt32BE(20);
17
+ if(width!==height||![40,80,120].includes(width))throw Error('callKitIcon must be a square PNG: 40, 80, or 120 pixels for a 40-point icon.');
18
+ let alpha=[4,6].includes(data[25]),ended=false;
19
+ for(let offset=8;offset+12<=data.length;){
20
+ const length=data.readUInt32BE(offset),type=data.toString('ascii',offset+4,offset+8);
21
+ if(length>data.length-offset-12)throw Error('callKitIcon contains an incomplete PNG chunk.');
22
+ if(type==='tRNS')alpha=true;
23
+ offset+=length+12;
24
+ if(type==='IEND'){ended=true;break;}
25
+ }
26
+ if(!ended||!alpha)throw Error('callKitIcon must be a complete PNG with an alpha channel for Apple’s template mask.');
27
+ return data;
28
+ }
29
+ function installIcon(project,{projectRoot,platformProjectRoot,projectName,input}){
30
+ const data=Buffer.isBuffer(input)?validateIcon(input):readIcon(projectRoot,input);
31
+ const directory=path.join(platformProjectRoot,projectName);
32
+ fs.mkdirSync(directory,{recursive:true});
33
+ fs.writeFileSync(path.join(directory,resource),data);
34
+ const target=IOSConfig.XcodeUtils.getApplicationNativeTarget({project,projectName}).uuid;
35
+ IOSConfig.XcodeUtils.addResourceFileToGroup({filepath:`${projectName}/${resource}`,groupName:projectName,project,isBuildFile:true,targetUuid:target});
36
+ // Resolve from the project root, even when the host's app group has a path.
37
+ for(const file of Object.values(project.pbxFileReferenceSection())){
38
+ if(typeof file==='object'&&file.path?.replaceAll('"','')===`${projectName}/${resource}`)file.sourceTree='SOURCE_ROOT';
39
+ }
40
+ return project;
41
+ }
42
+ function resolveIcon(projectRoot,input){
43
+ if(input!==undefined)return input;
44
+ const file=path.join(projectRoot,'.robono','callkit-icon.json');
45
+ if(!fs.existsSync(file))return undefined;
46
+ if(!fs.statSync(file).isFile()||fs.statSync(file).size>90000)throw Error('Invalid .robono/callkit-icon.json: download the iPhone icon setup again.');
47
+ const setup=JSON.parse(fs.readFileSync(file,'utf8'));
48
+ if(setup?.format!=='robono-callkit-icon'||setup.version!==1)throw Error('Unsupported iPhone icon setup. Download it again from Robono.');
49
+ if(setup.pngBase64===null)return null;
50
+ if(typeof setup.pngBase64!=='string'||setup.pngBase64.length>87384||!/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(setup.pngBase64))throw Error('Invalid iPhone icon PNG data.');
51
+ const data=validateIcon(Buffer.from(setup.pngBase64,'base64'));
52
+ if(data.length>65536||data.readUInt32BE(16)!==120||data[25]!==6)throw Error('Invalid website iPhone icon size or format.');
53
+ return data;
54
+ }
55
+ function withCallKitIcon(config,input){
56
+ config=withInfoPlist(config,c=>{
57
+ const icon=resolveIcon(c.modRequest.projectRoot,input);
58
+ if(icon===null)delete c.modResults[plistKey];else if(icon!==undefined)c.modResults[plistKey]=resource;
59
+ return c;
60
+ });
61
+ return withXcodeProject(config,c=>{
62
+ const icon=resolveIcon(c.modRequest.projectRoot,input);
63
+ if(icon!==undefined&&icon!==null)installIcon(c.modResults,{projectRoot:c.modRequest.projectRoot,platformProjectRoot:c.modRequest.platformProjectRoot,projectName:IOSConfig.XcodeUtils.getProjectName(c.modRequest.projectRoot),input:icon});
64
+ return c;
65
+ });
66
+ }
67
+ module.exports={withCallKitIcon,installIcon,readIcon,resolveIcon,resource,plistKey};