react-native-contacts 8.0.2 → 8.0.4
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/README.md +1 -1
- package/android/src/main/java/com/rt2zz/reactnativecontacts/impl/ContactsManagerImpl.java +1336 -0
- package/android/src/newarch/com/rt2zz/reactnativecontacts/ContactsManager.java +25 -1139
- package/android/src/oldarch/com/rt2zz/reactnativecontacts/ContactsManager.java +24 -1135
- package/ios/RCTContacts/RCTContacts.mm +42 -8
- package/package.json +1 -1
|
@@ -60,12 +60,15 @@ RCT_EXPORT_METHOD(checkPermission:(RCTPromiseResolveBlock) resolve
|
|
|
60
60
|
rejecter:(RCTPromiseRejectBlock) __unused reject)
|
|
61
61
|
{
|
|
62
62
|
CNAuthorizationStatus authStatus = [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts];
|
|
63
|
+
|
|
63
64
|
if (authStatus == CNAuthorizationStatusDenied || authStatus == CNAuthorizationStatusRestricted){
|
|
64
65
|
resolve(@"denied");
|
|
65
66
|
} else if (authStatus == CNAuthorizationStatusAuthorized){
|
|
66
67
|
resolve(@"authorized");
|
|
67
|
-
} else if
|
|
68
|
-
|
|
68
|
+
} else if(@available(iOS 18, *)) {
|
|
69
|
+
if (authStatus == CNAuthorizationStatusLimited) {
|
|
70
|
+
resolve(@"limited");
|
|
71
|
+
}
|
|
69
72
|
} else {
|
|
70
73
|
resolve(@"undefined");
|
|
71
74
|
}
|
|
@@ -568,10 +571,17 @@ RCT_EXPORT_METHOD(getPhotoForId:(nonnull NSString *)recordID resolver:(RCTPromis
|
|
|
568
571
|
}
|
|
569
572
|
}];
|
|
570
573
|
}
|
|
571
|
-
else if(
|
|
574
|
+
else if([CNContactStore authorizationStatusForEntityType:entityType]== CNAuthorizationStatusAuthorized)
|
|
572
575
|
{
|
|
573
576
|
resolve([self getFilePathForThumbnailImage:recordID addressBook:contactStore]);
|
|
574
577
|
}
|
|
578
|
+
else if(@available(iOS 18, *))
|
|
579
|
+
{
|
|
580
|
+
if([CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusLimited)
|
|
581
|
+
{
|
|
582
|
+
resolve([self getFilePathForThumbnailImage:recordID addressBook:contactStore]);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
575
585
|
}
|
|
576
586
|
|
|
577
587
|
-(NSString *) getFilePathForThumbnailImage:(NSString *)recordID
|
|
@@ -606,10 +616,17 @@ RCT_EXPORT_METHOD(getContactById:(nonnull NSString *)recordID resolver:(RCTPromi
|
|
|
606
616
|
}
|
|
607
617
|
}];
|
|
608
618
|
}
|
|
609
|
-
else if(
|
|
619
|
+
else if([CNContactStore authorizationStatusForEntityType:entityType]== CNAuthorizationStatusAuthorized)
|
|
610
620
|
{
|
|
611
621
|
resolve([self getContact:recordID addressBook:contactStore withThumbnails:false]);
|
|
612
622
|
}
|
|
623
|
+
else if(@available(iOS 18, *))
|
|
624
|
+
{
|
|
625
|
+
if([CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusLimited)
|
|
626
|
+
{
|
|
627
|
+
resolve([self getContact:recordID addressBook:contactStore withThumbnails:false]);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
613
630
|
}
|
|
614
631
|
|
|
615
632
|
-(NSDictionary *) getContact:(NSString *)recordID
|
|
@@ -1288,8 +1305,10 @@ RCT_EXPORT_METHOD(writePhotoToPath:(nonnull NSString *)path resolver:(RCTPromise
|
|
|
1288
1305
|
resolve(@"denied");
|
|
1289
1306
|
} else if (authStatus == CNAuthorizationStatusAuthorized){
|
|
1290
1307
|
resolve(@"authorized");
|
|
1291
|
-
} else if
|
|
1292
|
-
|
|
1308
|
+
} else if(@available(iOS 18, *)) {
|
|
1309
|
+
if (authStatus == CNAuthorizationStatusLimited) {
|
|
1310
|
+
resolve(@"limited");
|
|
1311
|
+
}
|
|
1293
1312
|
} else {
|
|
1294
1313
|
resolve(@"undefined");
|
|
1295
1314
|
}
|
|
@@ -1440,10 +1459,17 @@ RCT_EXPORT_METHOD(writePhotoToPath:(nonnull NSString *)path resolver:(RCTPromise
|
|
|
1440
1459
|
}
|
|
1441
1460
|
}];
|
|
1442
1461
|
}
|
|
1443
|
-
else if(
|
|
1462
|
+
else if([CNContactStore authorizationStatusForEntityType:entityType]== CNAuthorizationStatusAuthorized)
|
|
1444
1463
|
{
|
|
1445
1464
|
resolve([self getContact:recordID addressBook:contactStore withThumbnails:false]);
|
|
1446
1465
|
}
|
|
1466
|
+
else if(@available(iOS 18, *))
|
|
1467
|
+
{
|
|
1468
|
+
if([CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusLimited)
|
|
1469
|
+
{
|
|
1470
|
+
resolve([self getContact:recordID addressBook:contactStore withThumbnails:false]);
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1447
1473
|
}
|
|
1448
1474
|
|
|
1449
1475
|
|
|
@@ -1490,10 +1516,18 @@ RCT_EXPORT_METHOD(writePhotoToPath:(nonnull NSString *)path resolver:(RCTPromise
|
|
|
1490
1516
|
}
|
|
1491
1517
|
}];
|
|
1492
1518
|
}
|
|
1493
|
-
else if(
|
|
1519
|
+
else if([CNContactStore authorizationStatusForEntityType:entityType]== CNAuthorizationStatusAuthorized)
|
|
1494
1520
|
{
|
|
1495
1521
|
resolve([self getFilePathForThumbnailImage:recordID addressBook:contactStore]);
|
|
1496
1522
|
}
|
|
1523
|
+
else if(@available(iOS 18, *))
|
|
1524
|
+
{
|
|
1525
|
+
if([CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusLimited)
|
|
1526
|
+
{
|
|
1527
|
+
resolve([self getFilePathForThumbnailImage:recordID addressBook:contactStore]);
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
}
|
|
1497
1531
|
}
|
|
1498
1532
|
|
|
1499
1533
|
|