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 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._
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'host.exp.exponent'
4
- version = '13.0.2'
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.2"
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?, promise: Promise ->
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>?, options: Map<String, Any?>?, promise: Promise ->
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(contact: Contact?, data: Map<String, Any>): Contact {
329
- val contact = contact ?: Contact(UUID.randomUUID().toString())
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
- queryField: String?,
568
+ initQueryField: String?,
569
569
  keysToFetch: Set<String>,
570
570
  sortOrder: String?
571
571
  ): ContactPage? {
572
- val queryField = queryField ?: ContactsContract.Data.CONTACT_ID
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>
@@ -137,7 +137,7 @@ abstract class BaseModel : CommonProvider {
137
137
  }
138
138
 
139
139
  return input.map {
140
- val item = clazz.newInstance()
140
+ val item = clazz.getDeclaredConstructor().newInstance()
141
141
  item.fromMap(it)
142
142
  item
143
143
  }.toMutableList()
@@ -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: ??
@@ -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.dates
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.2",
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": "20f1765146f63f8fdc2543e8aba8b0e5140d1e05"
42
+ "gitHead": "81f5c3d7f38f3cc0b506d713a2346f33a38ce86f"
43
43
  }