Skip to content

Commit a9c20af

Browse files
committed
fix(capacitor): fixing capacitor 2 support
1 parent e05865c commit a9c20af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/utils/platform.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ const isCordova = (win: any): boolean => !!(win['cordova'] || win['phonegap'] ||
9999

100100
const isCapacitorNative = (win: any): boolean => {
101101
const capacitor = win['Capacitor'];
102-
return !!capacitor?.isNativePlatform();
102+
// TODO: Remove when we no longer support Capacitor 2, which does not have isNativePlatform
103+
return !!capacitor?.isNative || (capacitor?.isNativePlatform && !!capacitor.isNativePlatform());
103104
};
104105

105106
const isElectron = (win: Window): boolean => testUserAgent(win, /electron/i);

0 commit comments

Comments
 (0)