Skip to content
This repository was archived by the owner on Feb 10, 2023. It is now read-only.

Commit 32f96ff

Browse files
committed
feat(error-handling): Improve config error handling
see #51
1 parent 4f06a72 commit 32f96ff

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ The android:launchMode="singleTask" tells the Android operating system to launch
126126

127127
# FAQ
128128

129+
## Callback handling
130+
131+
The "handleOpenURL" callback must be called before application initialization, otherwise you'll see this error in the console:
132+
133+
```
134+
No callback provided. Please ensure that you called "handleOpenURL" during application init!
135+
```
136+
129137
## Webpack
130138

131139
### TypeScript Config

urlhandler.common.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,10 @@ export function handleOpenURL(handler: UrlHandlerCallback): void {
3636
}
3737

3838
export function getCallback(): UrlHandlerCallback {
39+
if (!URL_HANDLER_CB) {
40+
URL_HANDLER_CB = function () {
41+
console.error('No callback provided. Please ensure that you called "handleOpenURL" during application init!');
42+
};
43+
}
3944
return URL_HANDLER_CB;
4045
}

0 commit comments

Comments
 (0)