Skip to content

Commit 3e999af

Browse files
committed
fix: ios build
1 parent 0faef12 commit 3e999af

3 files changed

Lines changed: 2 additions & 28 deletions

File tree

example/src/App.tsx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
1-
import React, { useEffect } from 'react';
1+
import React from 'react';
22
import { StyleSheet, Text, View } from 'react-native';
33
import { SafeAreaProvider } from 'react-native-safe-area-context';
44

55
import ContactsDemoScreen from './screens/ContactsDemoScreen';
6-
import { getUpdatedSincePaged } from '@omarsdev/react-native-contacts';
76

87
export default function App() {
98
const [totalContacts, setTotalContacts] = React.useState<number | null>(null);
109

11-
useEffect(() => {
12-
const getContacts = async () => {
13-
await getUpdatedSincePaged.listen(
14-
{ since: '', pageSize: 1 },
15-
async (page) => {
16-
console.log(`Page mode=${page.mode} size=${page.items.length}`, {
17-
items: page.items,
18-
});
19-
}
20-
);
21-
};
22-
23-
getContacts();
24-
});
25-
2610
return (
2711
<SafeAreaProvider>
2812
<View style={styles.container}>

example/src/components/InfoPanel.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,19 @@ const InfoPanel = React.memo(
2323
since,
2424
listLabel,
2525
listCount,
26-
totalCount,
2726
}: Props) => (
2827
<View style={styles.info}>
2928
<Text style={styles.text}>Delta status: {deltaStatus}</Text>
3029
<Text style={styles.text}>
3130
Granted: {String(granted)} • Loading: {String(loading)}
3231
</Text>
33-
<Text style={styles.text}>
32+
<Text style={styles.text} numberOfLines={1}>
3433
Since: {since || '(empty)'}
3534
{since?.startsWith('fp:') ? ' • fingerprint' : ''}
3635
</Text>
3736
<Text style={styles.text}>
3837
Showing {listCount} {listLabel}
3938
</Text>
40-
{typeof totalCount === 'number' ? (
41-
<Text style={styles.text}>Total device contacts: {totalCount}</Text>
42-
) : null}
4339
</View>
4440
)
4541
);

ios/ContactsLastUpdated.mm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
#import <Contacts/Contacts.h>
33
#import <Foundation/Foundation.h>
44

5-
- (void)getAll:(RCTPromiseResolveBlock)resolve
6-
reject:(RCTPromiseRejectBlock)reject
7-
{
8-
resolve(CLUFetchAllContacts());
9-
}
10-
115
@implementation ContactsLastUpdated
126
RCT_EXPORT_MODULE()
137

0 commit comments

Comments
 (0)