Skip to content

Commit 3022fbf

Browse files
committed
feat: added document set/get expiration using ISO8601 daters
1 parent f26970a commit 3022fbf

File tree

8 files changed

+82
-135
lines changed

8 files changed

+82
-135
lines changed

expo-example/android/app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ android {
110110
shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)
111111
minifyEnabled enableProguardInReleaseBuilds
112112
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
113+
crunchPngs (findProperty('android.enablePngCrunchInReleaseBuilds')?.toBoolean() ?: true)
113114
}
114115
}
115116
packagingOptions {

expo-example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ allprojects {
3939
maven { url 'https://www.jitpack.io' }
4040
}
4141
}
42-
apply from: "../../android/build.gradle"
42+
apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"

expo-example/android/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ android.useAndroidX=true
2525
# Automatically convert third-party libraries to use AndroidX
2626
android.enableJetifier=true
2727

28+
# Enable AAPT2 PNG crunching
29+
android.enablePngCrunchInReleaseBuilds=true
30+
2831
# Use this property to specify which architecture you want to build.
2932
# You can also override it from the CLI using
3033
# ./gradlew <task> -PreactNativeArchitectures=x86_64
Lines changed: 24 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,33 @@
1-
import React, { useContext, useState } from 'react';
2-
import { SafeAreaView, ScrollView } from 'react-native';
3-
import { useNavigation } from '@react-navigation/native';
4-
import { useStyleScheme } from '@/components/Themed';
5-
import ResultListView from '@/components/ResultsListView';
6-
import DatabaseContext from '@/providers/DatabaseContext';
7-
import useNavigationBarTitleResetOption from '@/hooks/useNavigationBarTitleResetOption';
8-
import DatabaseScopeCollectionForm from '@/components/DatabaseScopeCollectionForm';
9-
import HeaderView from '@/components/HeaderView';
10-
import DocumentIdActionForm from '@/components/DocumentIdActionForm';
11-
//import get from '@/service/document/get';
1+
import React from 'react';
2+
import CBLDocumentIdCollectionActionContainer from '@/components/CBLDocumentIdCollectionActionContainer';
3+
import getExpirationDate from '@/service/document/getExpirationDate';
4+
import { Collection } from 'cbl-reactnative';
125

136
export default function GetDocumentExpirationScreen() {
14-
//database stuff
15-
const { databases } = useContext(DatabaseContext)!;
16-
const [databaseName, setDatabaseName] = useState<string>('');
17-
const [scopeName, setScopeName] = useState<string>('');
18-
const [collectionName, setCollectionName] = useState<string>('');
19-
const [documentId, setDocumentId] = useState<string>('');
20-
//results
21-
const [resultMessage, setResultsMessage] = useState<string[]>([]);
22-
//drawing stuff
23-
const navigation = useNavigation();
24-
const styles = useStyleScheme();
25-
useNavigationBarTitleResetOption(
26-
'Get Document Expiration',
27-
navigation,
28-
reset
29-
);
30-
31-
function reset() {
32-
setDatabaseName('');
33-
setScopeName('');
34-
setCollectionName('');
35-
setDocumentId('');
36-
setResultsMessage([]);
37-
}
7+
function reset() {}
388

39-
const update = async () => {
40-
if (databaseName === '') {
41-
setResultsMessage((prev) => [
42-
...prev,
43-
'Error: Database name is required',
44-
]);
45-
} else {
46-
try {
47-
if (documentId === '') {
48-
setResultsMessage((prev) => [
49-
...prev,
50-
'Error: Document ID is required',
51-
]);
52-
return;
53-
}
54-
/*
55-
const doc = await get(
56-
databases,
57-
databaseName,
58-
scopeName,
59-
collectionName,
60-
documentId
61-
);
62-
if (doc !== undefined && doc !== null) {
63-
const json = JSON.stringify(doc.toDictionary());
64-
const resultsMessage = `Document <${documentId}> found with JSON: ${json}`;
65-
setResultsMessage((prev) => [...prev, resultsMessage]);
66-
} else {
67-
setResultsMessage((prev) => [
68-
...prev,
69-
'Error: Document could not be retrieved',
70-
]);
71-
}
72-
*/
73-
} catch (error) {
74-
// @ts-ignore
75-
setResultsMessage((prev) => [...prev, error.message]);
9+
async function update(
10+
collection: Collection,
11+
documentId: string
12+
): Promise<string[]> {
13+
try {
14+
const date = await getExpirationDate(collection, documentId);
15+
if (date !== null || date !== undefined) {
16+
return [`Document <${documentId}> expiration date is set to <${date}>`];
17+
} else {
18+
return [`Document <${documentId}> has no expiration date`];
7619
}
20+
} catch (error) {
21+
// @ts-ignore
22+
return [error.message];
7723
}
78-
};
24+
}
7925

8026
return (
81-
<SafeAreaView style={styles.container}>
82-
<ScrollView style={styles.container}>
83-
<HeaderView name="Collection" iconName="bookshelf" />
84-
<DatabaseScopeCollectionForm
85-
databaseName={databaseName}
86-
setDatabaseName={setDatabaseName}
87-
scopeName={scopeName}
88-
setScopeName={setScopeName}
89-
collectionName={collectionName}
90-
setCollectionName={setCollectionName}
91-
/>
92-
<DocumentIdActionForm
93-
documentId={documentId}
94-
setDocumentId={setDocumentId}
95-
handleUpdatePressed={update}
96-
/>
97-
<ResultListView messages={resultMessage} />
98-
</ScrollView>
99-
</SafeAreaView>
27+
<CBLDocumentIdCollectionActionContainer
28+
screenTitle="Get Document Expiration"
29+
handleUpdatePressed={update}
30+
handleResetPressed={reset}
31+
/>
10032
);
10133
}

expo-example/ios/expoexample.xcodeproj/project.pbxproj

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
1111
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
1212
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
13-
1E5CCFF4777BE78DA709F2AB /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 15B0E3A5E031534BEBBB3FAF /* PrivacyInfo.xcprivacy */; };
1413
3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */; };
15-
894767C38FAD4610A4BCA3FB /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3A1F1074EF24DF8BF91C2F9 /* noop-file.swift */; };
1614
96905EF65AED1B983A6B3ABC /* libPods-expoexample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-expoexample.a */; };
1715
B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */; };
1816
BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; };
17+
D54B062A43A347749A9A6B90 /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = D21B9DE8A68D41DC9D4C6EF7 /* noop-file.swift */; };
18+
EC1D923A906AE958E8C08BEA /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 8938667065399711C3753AEA /* PrivacyInfo.xcprivacy */; };
1919
/* End PBXBuildFile section */
2020

2121
/* Begin PBXFileReference section */
@@ -25,14 +25,14 @@
2525
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = expoexample/Images.xcassets; sourceTree = "<group>"; };
2626
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = expoexample/Info.plist; sourceTree = "<group>"; };
2727
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = expoexample/main.m; sourceTree = "<group>"; };
28-
15B0E3A5E031534BEBBB3FAF /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = expoexample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
2928
58EEBF8E8E6FB1BC6CAF49B5 /* libPods-expoexample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-expoexample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3029
6C2E3173556A471DD304B334 /* Pods-expoexample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-expoexample.debug.xcconfig"; path = "Target Support Files/Pods-expoexample/Pods-expoexample.debug.xcconfig"; sourceTree = "<group>"; };
3130
7A4D352CD337FB3A3BF06240 /* Pods-expoexample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-expoexample.release.xcconfig"; path = "Target Support Files/Pods-expoexample/Pods-expoexample.release.xcconfig"; sourceTree = "<group>"; };
31+
8938667065399711C3753AEA /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = expoexample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
3232
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = expoexample/SplashScreen.storyboard; sourceTree = "<group>"; };
33+
AD2CE394E724421C8BA88719 /* expoexample-Bridging-Header.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "expoexample-Bridging-Header.h"; path = "expoexample/expoexample-Bridging-Header.h"; sourceTree = "<group>"; };
3334
BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = "<group>"; };
34-
C3A1F1074EF24DF8BF91C2F9 /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "expoexample/noop-file.swift"; sourceTree = "<group>"; };
35-
E036B77BB73641B9A31D0AC6 /* expoexample-Bridging-Header.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "expoexample-Bridging-Header.h"; path = "expoexample/expoexample-Bridging-Header.h"; sourceTree = "<group>"; };
35+
D21B9DE8A68D41DC9D4C6EF7 /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "expoexample/noop-file.swift"; sourceTree = "<group>"; };
3636
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
3737
FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-expoexample/ExpoModulesProvider.swift"; sourceTree = "<group>"; };
3838
/* End PBXFileReference section */
@@ -59,9 +59,9 @@
5959
13B07FB61A68108700A75B9A /* Info.plist */,
6060
13B07FB71A68108700A75B9A /* main.m */,
6161
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */,
62-
C3A1F1074EF24DF8BF91C2F9 /* noop-file.swift */,
63-
E036B77BB73641B9A31D0AC6 /* expoexample-Bridging-Header.h */,
64-
15B0E3A5E031534BEBBB3FAF /* PrivacyInfo.xcprivacy */,
62+
D21B9DE8A68D41DC9D4C6EF7 /* noop-file.swift */,
63+
AD2CE394E724421C8BA88719 /* expoexample-Bridging-Header.h */,
64+
8938667065399711C3753AEA /* PrivacyInfo.xcprivacy */,
6565
);
6666
name = expoexample;
6767
sourceTree = "<group>";
@@ -147,13 +147,13 @@
147147
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "expoexample" */;
148148
buildPhases = (
149149
08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */,
150-
21658AA67C7BEE36C6067FC7 /* [Expo] Configure project */,
150+
DAECB2F152FA70A3C091CD39 /* [Expo] Configure project */,
151151
13B07F871A680F5B00A75B9A /* Sources */,
152152
13B07F8C1A680F5B00A75B9A /* Frameworks */,
153153
13B07F8E1A680F5B00A75B9A /* Resources */,
154154
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
155155
800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */,
156-
230752D94CBF6C295A02E3F4 /* [CP] Embed Pods Frameworks */,
156+
81F92B66582731597075F546 /* [CP] Embed Pods Frameworks */,
157157
);
158158
buildRules = (
159159
);
@@ -203,7 +203,7 @@
203203
BB2F792D24A3F905000567C9 /* Expo.plist in Resources */,
204204
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
205205
3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */,
206-
1E5CCFF4777BE78DA709F2AB /* PrivacyInfo.xcprivacy in Resources */,
206+
EC1D923A906AE958E8C08BEA /* PrivacyInfo.xcprivacy in Resources */,
207207
);
208208
runOnlyForDeploymentPostprocessing = 0;
209209
};
@@ -247,26 +247,37 @@
247247
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
248248
showEnvVarsInLog = 0;
249249
};
250-
21658AA67C7BEE36C6067FC7 /* [Expo] Configure project */ = {
250+
800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */ = {
251251
isa = PBXShellScriptBuildPhase;
252-
alwaysOutOfDate = 1;
253252
buildActionMask = 2147483647;
254253
files = (
255254
);
256-
inputFileListPaths = (
257-
);
258255
inputPaths = (
256+
"${PODS_ROOT}/Target Support Files/Pods-expoexample/Pods-expoexample-resources.sh",
257+
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
258+
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/ExpoConstants_privacy.bundle",
259+
"${PODS_CONFIGURATION_BUILD_DIR}/ExpoFileSystem/ExpoFileSystem_privacy.bundle",
260+
"${PODS_CONFIGURATION_BUILD_DIR}/ExpoSystemUI/ExpoSystemUI_privacy.bundle",
261+
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
262+
"${PODS_CONFIGURATION_BUILD_DIR}/expo-dev-launcher/EXDevLauncher.bundle",
263+
"${PODS_CONFIGURATION_BUILD_DIR}/expo-dev-menu/EXDevMenu.bundle",
259264
);
260-
name = "[Expo] Configure project";
261-
outputFileListPaths = (
262-
);
265+
name = "[CP] Copy Pods Resources";
263266
outputPaths = (
267+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle",
268+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoConstants_privacy.bundle",
269+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoFileSystem_privacy.bundle",
270+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoSystemUI_privacy.bundle",
271+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.bundle",
272+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXDevLauncher.bundle",
273+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXDevMenu.bundle",
264274
);
265275
runOnlyForDeploymentPostprocessing = 0;
266276
shellPath = /bin/sh;
267-
shellScript = "# This script configures Expo modules and generates the modules provider file.\nbash -l -c \"./Pods/Target\\ Support\\ Files/Pods-expoexample/expo-configure-project.sh\"\n";
277+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-expoexample/Pods-expoexample-resources.sh\"\n";
278+
showEnvVarsInLog = 0;
268279
};
269-
230752D94CBF6C295A02E3F4 /* [CP] Embed Pods Frameworks */ = {
280+
81F92B66582731597075F546 /* [CP] Embed Pods Frameworks */ = {
270281
isa = PBXShellScriptBuildPhase;
271282
buildActionMask = 2147483647;
272283
files = (
@@ -286,35 +297,24 @@
286297
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-expoexample/Pods-expoexample-frameworks.sh\"\n";
287298
showEnvVarsInLog = 0;
288299
};
289-
800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */ = {
300+
DAECB2F152FA70A3C091CD39 /* [Expo] Configure project */ = {
290301
isa = PBXShellScriptBuildPhase;
302+
alwaysOutOfDate = 1;
291303
buildActionMask = 2147483647;
292304
files = (
293305
);
306+
inputFileListPaths = (
307+
);
294308
inputPaths = (
295-
"${PODS_ROOT}/Target Support Files/Pods-expoexample/Pods-expoexample-resources.sh",
296-
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
297-
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/ExpoConstants_privacy.bundle",
298-
"${PODS_CONFIGURATION_BUILD_DIR}/ExpoFileSystem/ExpoFileSystem_privacy.bundle",
299-
"${PODS_CONFIGURATION_BUILD_DIR}/ExpoSystemUI/ExpoSystemUI_privacy.bundle",
300-
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
301-
"${PODS_CONFIGURATION_BUILD_DIR}/expo-dev-launcher/EXDevLauncher.bundle",
302-
"${PODS_CONFIGURATION_BUILD_DIR}/expo-dev-menu/EXDevMenu.bundle",
303309
);
304-
name = "[CP] Copy Pods Resources";
310+
name = "[Expo] Configure project";
311+
outputFileListPaths = (
312+
);
305313
outputPaths = (
306-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle",
307-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoConstants_privacy.bundle",
308-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoFileSystem_privacy.bundle",
309-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoSystemUI_privacy.bundle",
310-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.bundle",
311-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXDevLauncher.bundle",
312-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXDevMenu.bundle",
313314
);
314315
runOnlyForDeploymentPostprocessing = 0;
315316
shellPath = /bin/sh;
316-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-expoexample/Pods-expoexample-resources.sh\"\n";
317-
showEnvVarsInLog = 0;
317+
shellScript = "# This script configures Expo modules and generates the modules provider file.\nbash -l -c \"./Pods/Target\\ Support\\ Files/Pods-expoexample/expo-configure-project.sh\"\n";
318318
};
319319
/* End PBXShellScriptBuildPhase section */
320320

@@ -326,7 +326,7 @@
326326
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
327327
13B07FC11A68108700A75B9A /* main.m in Sources */,
328328
B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */,
329-
894767C38FAD4610A4BCA3FB /* noop-file.swift in Sources */,
329+
D54B062A43A347749A9A6B90 /* noop-file.swift in Sources */,
330330
);
331331
runOnlyForDeploymentPostprocessing = 0;
332332
};
@@ -357,7 +357,7 @@
357357
);
358358
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
359359
PRODUCT_BUNDLE_IDENTIFIER = "com.couchbase.rn.expo-example";
360-
PRODUCT_NAME = expoexample;
360+
PRODUCT_NAME = "expoexample";
361361
SWIFT_OBJC_BRIDGING_HEADER = "expoexample/expoexample-Bridging-Header.h";
362362
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
363363
SWIFT_VERSION = 5.0;
@@ -385,7 +385,7 @@
385385
);
386386
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
387387
PRODUCT_BUNDLE_IDENTIFIER = "com.couchbase.rn.expo-example";
388-
PRODUCT_NAME = expoexample;
388+
PRODUCT_NAME = "expoexample";
389389
SWIFT_OBJC_BRIDGING_HEADER = "expoexample/expoexample-Bridging-Header.h";
390390
SWIFT_VERSION = 5.0;
391391
TARGETED_DEVICE_FAMILY = "1,2";

expo-example/ios/expoexample/Info.plist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<key>NSUserActivityTypes</key>
5353
<array>
5454
<string>$(PRODUCT_BUNDLE_IDENTIFIER).expo.index_route</string>
55+
<string>$(PRODUCT_BUNDLE_IDENTIFIER).expo.index_route</string>
5556
</array>
5657
<key>UILaunchStoryboardName</key>
5758
<string>SplashScreen</string>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Collection } from 'cbl-reactnative';
2+
3+
export default async function setExpirationDate(
4+
collection: Collection,
5+
documentId: string
6+
): Promise<Date | null> {
7+
const date = await collection.getDocumentExpiration(documentId);
8+
return date;
9+
}

ios/CblReactnative.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ class CblReactnative: NSObject {
504504
}
505505
let strExpiration = String(expiration)
506506
let formatter = ISO8601DateFormatter()
507+
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
507508
if let date = formatter.date(from: strExpiration) {
508509
try CollectionManager.shared.setDocumentExpiration(
509510
documentId,

0 commit comments

Comments
 (0)