expo-contacts 13.0.2 → 13.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/CHANGELOG.md +8 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/contacts/ContactsModule.kt +6 -6
- package/android/src/main/java/expo/modules/contacts/models/BaseModel.kt +1 -1
- package/android/src/main/java/expo/modules/contacts/models/DateModel.kt +2 -2
- package/ios/Serialization.swift +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 13.0.4 — 2024-06-10
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 13.0.3 — 2024-05-01
|
|
18
|
+
|
|
19
|
+
_This version does not introduce any user-facing changes._
|
|
20
|
+
|
|
13
21
|
## 13.0.2 — 2024-04-26
|
|
14
22
|
|
|
15
23
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
|
|
3
3
|
group = 'host.exp.exponent'
|
|
4
|
-
version = '13.0.
|
|
4
|
+
version = '13.0.4'
|
|
5
5
|
|
|
6
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
7
7
|
apply from: expoModulesCorePlugin
|
|
@@ -14,7 +14,7 @@ android {
|
|
|
14
14
|
namespace "expo.modules.contacts"
|
|
15
15
|
defaultConfig {
|
|
16
16
|
versionCode 29
|
|
17
|
-
versionName "13.0.
|
|
17
|
+
versionName "13.0.4"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -223,7 +223,7 @@ class ContactsModule : Module() {
|
|
|
223
223
|
resolver.delete(uri, null, null)
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
AsyncFunction("shareContactAsync") { contactId: String?, subject: String
|
|
226
|
+
AsyncFunction("shareContactAsync") { contactId: String?, subject: String? ->
|
|
227
227
|
val lookupKey = getLookupKeyForContactId(contactId) ?: throw LookupKeyNotFoundException()
|
|
228
228
|
|
|
229
229
|
val uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookupKey)
|
|
@@ -243,7 +243,7 @@ class ContactsModule : Module() {
|
|
|
243
243
|
uri.toString()
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
AsyncFunction("presentFormAsync") { contactId: String?, contactData: Map<String, Any>?,
|
|
246
|
+
AsyncFunction("presentFormAsync") { contactId: String?, contactData: Map<String, Any>?, _: Map<String, Any?>?, promise: Promise ->
|
|
247
247
|
ensureReadPermission()
|
|
248
248
|
|
|
249
249
|
if (contactManipulationPromise != null) {
|
|
@@ -325,8 +325,8 @@ class ContactsModule : Module() {
|
|
|
325
325
|
private val resolver: ContentResolver
|
|
326
326
|
get() = (appContext.reactContext ?: throw Exceptions.ReactContextLost()).contentResolver
|
|
327
327
|
|
|
328
|
-
private fun mutateContact(
|
|
329
|
-
val contact =
|
|
328
|
+
private fun mutateContact(initContact: Contact?, data: Map<String, Any>): Contact {
|
|
329
|
+
val contact = initContact ?: Contact(UUID.randomUUID().toString())
|
|
330
330
|
|
|
331
331
|
data.safeGet<String>("firstName")?.let { contact.firstName = it }
|
|
332
332
|
data.safeGet<String>("middleName")?.let { contact.middleName = it }
|
|
@@ -565,11 +565,11 @@ class ContactsModule : Module() {
|
|
|
565
565
|
pageOffset: Int,
|
|
566
566
|
pageSize: Int,
|
|
567
567
|
queryStrings: Array<String>?,
|
|
568
|
-
|
|
568
|
+
initQueryField: String?,
|
|
569
569
|
keysToFetch: Set<String>,
|
|
570
570
|
sortOrder: String?
|
|
571
571
|
): ContactPage? {
|
|
572
|
-
val queryField =
|
|
572
|
+
val queryField = initQueryField ?: ContactsContract.Data.CONTACT_ID
|
|
573
573
|
val getAll = pageSize == 0
|
|
574
574
|
val queryArguments = createProjectionForQuery(keysToFetch)
|
|
575
575
|
val contacts: Map<String, Contact>
|
|
@@ -29,9 +29,9 @@ class DateModel : BaseModel() {
|
|
|
29
29
|
val noYearPattern = SimpleDateFormat("--MM-dd", Locale.getDefault())
|
|
30
30
|
try {
|
|
31
31
|
if (hasYear) {
|
|
32
|
-
calendar.time = datePattern.parse(dateString)
|
|
32
|
+
calendar.time = datePattern.parse(dateString)!!
|
|
33
33
|
} else {
|
|
34
|
-
calendar.time = noYearPattern.parse(dateString)
|
|
34
|
+
calendar.time = noYearPattern.parse(dateString)!!
|
|
35
35
|
}
|
|
36
36
|
} catch (e: Exception) {
|
|
37
37
|
// TODO: ??
|
package/ios/Serialization.swift
CHANGED
|
@@ -236,7 +236,7 @@ func serializeContact(person: CNContact, keys: [String]?, directory: URL?) throw
|
|
|
236
236
|
contact[ContactsKey.jobTitle] = person.jobTitle
|
|
237
237
|
}
|
|
238
238
|
if fieldHasValue(field: person.departmentName) {
|
|
239
|
-
contact[ContactsKey.department] = person.
|
|
239
|
+
contact[ContactsKey.department] = person.departmentName
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
if keysToFetch.contains(CNContactNamePrefixKey) && fieldHasValue(field: person.namePrefix) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-contacts",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.4",
|
|
4
4
|
"description": "Provides access to the phone's system contacts.",
|
|
5
5
|
"main": "build/Contacts.js",
|
|
6
6
|
"types": "build/Contacts.d.ts",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"expo": "*"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "81f5c3d7f38f3cc0b506d713a2346f33a38ce86f"
|
|
43
43
|
}
|