Skip to content

Commit 4cc998f

Browse files
committed
feat: Bump version to 2.4.6 and update changelog; fix VCF import issue
1 parent c2753fb commit 4cc998f

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ android {
101101
applicationId 'com.lulu786.Alternate'
102102
minSdkVersion rootProject.ext.minSdkVersion
103103
targetSdkVersion rootProject.ext.targetSdkVersion
104-
versionCode 13
105-
versionName "2.4.5"
104+
versionCode 14
105+
versionName "2.4.6"
106106
}
107107

108108
signingConfigs {

app.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"expo": {
33
"name": "Alternate",
44
"slug": "alternate",
5-
"version": "2.4.5",
5+
"version": "2.4.6",
66
"orientation": "portrait",
77
"scheme": "alternate",
88
"userInterfaceStyle": "automatic",
@@ -20,7 +20,7 @@
2020
}
2121
},
2222
"android": {
23-
"versionCode": 13,
23+
"versionCode": 14,
2424
"adaptiveIcon": {
2525
"foregroundImage": "./assets/icon/adaptive-icon.png",
2626
"monochromeImage": "./assets/icon/adaptive-icon.png",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
v2.4.6 - Bug Fixes
2+
- Fixed vcf import issue

lib/vcf-utils.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { getCountryByDialCode } from "@/lib/countries";
22
import type { Contact } from "@/lib/types";
33
import { getFormattedName } from "@/lib/utils";
4+
import CallerIdModule from "@/modules/caller-id";
45
import * as DocumentPicker from "expo-document-picker";
56
import * as FileSystem from "expo-file-system";
67
import { shareAsync } from "expo-sharing";
7-
import { parsePhoneNumberWithError } from "libphonenumber-js";
8+
import { type CountryCode, parsePhoneNumberWithError } from "libphonenumber-js";
89
import { Platform } from "react-native";
910

1011
/**
@@ -119,13 +120,13 @@ function unescapeVCFValue(value: string): string {
119120
/**
120121
* Parses a phone number to extract country code and number
121122
*/
122-
function parsePhoneNumber(phoneStr: string): {
123+
function parsePhoneNumber(phoneStr: string, countryCode: string): {
123124
countryCode: string;
124125
phoneNumber: string;
125126
fullPhoneNumber: string;
126127
} | null {
127128
try {
128-
const phoneProto = parsePhoneNumberWithError(phoneStr, "IN");
129+
const phoneProto = parsePhoneNumberWithError(phoneStr, countryCode as CountryCode);
129130

130131
return {
131132
countryCode:
@@ -148,6 +149,7 @@ function parsePhoneNumber(phoneStr: string): {
148149
*/
149150
export function parseVCF(vcfContent: string): Contact[] {
150151
const contacts: Contact[] = [];
152+
const countryCode = CallerIdModule.getDialCountryCode();
151153

152154
// Normalize and unfold content in one pass
153155
const processedContent = vcfContent
@@ -206,7 +208,7 @@ export function parseVCF(vcfContent: string): Contact[] {
206208
}
207209

208210
case field.startsWith("TEL") && !contact.fullPhoneNumber: {
209-
const phone = parsePhoneNumber(value);
211+
const phone = parsePhoneNumber(value, countryCode);
210212
if (!phone) break;
211213
Object.assign(contact, phone);
212214
break;

0 commit comments

Comments
 (0)