react-native-contacts 8.0.6 → 8.0.8
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.
|
@@ -12,6 +12,8 @@ import com.facebook.react.bridge.Promise;
|
|
|
12
12
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
13
13
|
import com.facebook.react.bridge.ReadableMap;
|
|
14
14
|
import com.rt2zz.reactnativecontacts.impl.ContactsManagerImpl;
|
|
15
|
+
import com.facebook.react.bridge.Promise;
|
|
16
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
15
17
|
|
|
16
18
|
import java.io.ByteArrayOutputStream;
|
|
17
19
|
import java.io.IOException;
|
|
@@ -27,6 +29,46 @@ public class ContactsManager extends NativeContactsSpec implements ActivityEvent
|
|
|
27
29
|
reactContext.addActivityEventListener(this);
|
|
28
30
|
}
|
|
29
31
|
|
|
32
|
+
@Override
|
|
33
|
+
public void removeContactsFromGroup(String groupId, ReadableArray contactIds, Promise promise) {
|
|
34
|
+
promise.reject("E_NOT_IMPLEMENTED", "removeContactsFromGroup not implemented yet");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@Override
|
|
38
|
+
public void addContactsToGroup(String groupId, ReadableArray contactIds, Promise promise) {
|
|
39
|
+
promise.reject("E_NOT_IMPLEMENTED", "addContactsToGroup not implemented yet");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@Override
|
|
43
|
+
public void contactsInGroup(String groupId, Promise promise) {
|
|
44
|
+
promise.reject("E_NOT_IMPLEMENTED", "contactsInGroup not implemented yet");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@Override
|
|
48
|
+
public void addGroup(ReadableMap groupData, Promise promise) {
|
|
49
|
+
promise.reject("E_NOT_IMPLEMENTED", "addGroup not implemented yet");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@Override
|
|
53
|
+
public void updateGroup(String groupId, ReadableMap groupData, Promise promise) {
|
|
54
|
+
promise.reject("E_NOT_IMPLEMENTED", "updateGroup not implemented yet");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@Override
|
|
58
|
+
public void deleteGroup(String groupId, Promise promise) {
|
|
59
|
+
promise.reject("E_NOT_IMPLEMENTED", "deleteGroup not implemented yet");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@Override
|
|
63
|
+
public void getGroup(String groupId, Promise promise) {
|
|
64
|
+
promise.reject("E_NOT_IMPLEMENTED", "getGroup not implemented yet");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@Override
|
|
68
|
+
public void getGroups(Promise promise) {
|
|
69
|
+
promise.reject("E_NOT_IMPLEMENTED", "getGroups not implemented yet");
|
|
70
|
+
}
|
|
71
|
+
|
|
30
72
|
/*
|
|
31
73
|
* Returns all contactable records on phone
|
|
32
74
|
* queries CommonDataKinds.Contactables to get phones and emails
|
package/index.d.ts
CHANGED
|
@@ -24,10 +24,10 @@ export function getContactsByEmailAddress(
|
|
|
24
24
|
emailAddress: string
|
|
25
25
|
): Promise<Contact[]>;
|
|
26
26
|
export function checkPermission(): Promise<
|
|
27
|
-
"authorized" | "denied" | "undefined"
|
|
27
|
+
"authorized" | "denied" | "undefined" | "limited"
|
|
28
28
|
>;
|
|
29
29
|
export function requestPermission(): Promise<
|
|
30
|
-
"authorized" | "denied" | "undefined"
|
|
30
|
+
"authorized" | "denied" | "undefined" | "limited"
|
|
31
31
|
>;
|
|
32
32
|
export function writePhotoToPath(
|
|
33
33
|
contactId: string,
|
|
@@ -63,7 +63,7 @@ RCT_EXPORT_METHOD(checkPermission:(RCTPromiseResolveBlock)resolve
|
|
|
63
63
|
} else if (authStatus == CNAuthorizationStatusAuthorized) {
|
|
64
64
|
resolve(@"authorized");
|
|
65
65
|
} else if (@available(iOS 18, *)) {
|
|
66
|
-
if (authStatus ==
|
|
66
|
+
if (authStatus == CNAuthorizationStatusLimited) {
|
|
67
67
|
resolve(@"limited");
|
|
68
68
|
} else {
|
|
69
69
|
resolve(@"undefined");
|
package/package.json
CHANGED
package/src/NativeContacts.ts
CHANGED
|
@@ -22,20 +22,20 @@ export interface Spec extends TurboModule {
|
|
|
22
22
|
requestPermission: () => Promise<PermissionType>;
|
|
23
23
|
writePhotoToPath: (contactId: string, file: string) => Promise<boolean>;
|
|
24
24
|
iosEnableNotesUsage: (enabled: boolean) => void;
|
|
25
|
-
getGroups()
|
|
26
|
-
getGroup
|
|
27
|
-
deleteGroup(identifier: string)
|
|
28
|
-
updateGroup(identifier: string, groupData: Object)
|
|
29
|
-
addGroup(group: Object)
|
|
30
|
-
contactsInGroup(identifier: string)
|
|
31
|
-
addContactsToGroup(
|
|
25
|
+
getGroups?: () => Promise<Group[]>;
|
|
26
|
+
getGroup?: (identifier: string) => Promise<Group | null>;
|
|
27
|
+
deleteGroup?: (identifier: string) => Promise<boolean>;
|
|
28
|
+
updateGroup?: (identifier: string, groupData: Object) => Promise<Group>;
|
|
29
|
+
addGroup?: (group: Object) => Promise<Group>;
|
|
30
|
+
contactsInGroup?: (identifier: string) => Promise<Contact[]>;
|
|
31
|
+
addContactsToGroup?: (
|
|
32
32
|
groupIdentifier: string,
|
|
33
33
|
contactIdentifiers: string[]
|
|
34
|
-
)
|
|
35
|
-
removeContactsFromGroup(
|
|
34
|
+
) => Promise<boolean>;
|
|
35
|
+
removeContactsFromGroup?: (
|
|
36
36
|
groupIdentifier: string,
|
|
37
37
|
contactIdentifiers: string[]
|
|
38
|
-
)
|
|
38
|
+
) => Promise<boolean>;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export default TurboModuleRegistry.get<Spec>("RCTContacts");
|
package/.tool-versions
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodejs 22.15.0
|