Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support 0.76.0 with new arch enabled #760

Closed
SolankiYogesh opened this issue Oct 24, 2024 · 5 comments
Closed

support 0.76.0 with new arch enabled #760

SolankiYogesh opened this issue Oct 24, 2024 · 5 comments

Comments

@SolankiYogesh
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-contacts@8.0.3 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-contacts/ios/RCTContacts/RCTContacts.mm b/node_modules/react-native-contacts/ios/RCTContacts/RCTContacts.mm
index feaf0da..0a5a528 100644
--- a/node_modules/react-native-contacts/ios/RCTContacts/RCTContacts.mm
+++ b/node_modules/react-native-contacts/ios/RCTContacts/RCTContacts.mm
@@ -66,7 +66,7 @@ - (NSDictionary *)constantsToExport
     } else if (authStatus == CNAuthorizationStatusAuthorized){
         resolve(@"authorized");
     } else if(@available(iOS 18, *)) {
-        if (authStatus == CNAuthorizationStatusLimited) {
+        if (authStatus == PHAuthorizationStatusLimited) {
             resolve(@"limited");
         }
     } else {
@@ -577,7 +577,7 @@ - (NSString *)getPathForDirectory:(int)directory
     }
     else if(@available(iOS 18, *))
     {
-        if([CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusLimited)
+        if([CNContactStore authorizationStatusForEntityType:entityType] == PHAuthorizationStatusLimited)
         {
             resolve([self getFilePathForThumbnailImage:recordID addressBook:contactStore]);
         }
@@ -622,7 +622,7 @@ -(NSString *) getFilePathForThumbnailImage:(NSString *)recordID
     }
     else if(@available(iOS 18, *))
     {
-        if([CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusLimited)
+        if([CNContactStore authorizationStatusForEntityType:entityType] == PHAuthorizationStatusLimited)
         {
             resolve([self getContact:recordID addressBook:contactStore withThumbnails:false]);
         }
@@ -1306,7 +1306,7 @@ - (void)checkPermission:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseReject
      } else if (authStatus == CNAuthorizationStatusAuthorized){
          resolve(@"authorized");
      } else if(@available(iOS 18, *)) {
-         if (authStatus == CNAuthorizationStatusLimited) {
+         if (authStatus == PHAuthorizationStatusLimited) {
              resolve(@"limited");
          }
      } else {
@@ -1465,7 +1465,7 @@ - (void)getContactById:(nonnull NSString *)recordID resolve:(RCTPromiseResolveBl
      }
      else if(@available(iOS 18, *))
      {
-        if([CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusLimited)
+         if([CNContactStore authorizationStatusForEntityType:entityType] == PHAuthorizationStatusLimited)
         {
             resolve([self getContact:recordID addressBook:contactStore withThumbnails:false]);
         }
@@ -1522,7 +1522,7 @@ - (void)getPhotoForId:(nonnull NSString *)recordID resolve:(RCTPromiseResolveBlo
         }
         else if(@available(iOS 18, *))
         {
-            if([CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusLimited)
+            if([CNContactStore authorizationStatusForEntityType:entityType] == PHAuthorizationStatusLimited)
             {
                 resolve([self getFilePathForThumbnailImage:recordID addressBook:contactStore]);
             }

This issue body was partially generated by patch-package.

@morenoh149
Copy link
Owner

thanks! If anyone wants to submit this as a PR it would be merged.

@ceejeey
Copy link

ceejeey commented Oct 27, 2024

Please do @morenoh149

@SolankiYogesh
Copy link
Author

@morenoh149 added PR with example repo link
#761

@joaonew
Copy link

joaonew commented Nov 14, 2024

Do we already have support for the new arch?

@morenoh149
Copy link
Owner

I think the new architecure was already enabled in this PR in September #739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants