Skip to content

Commit 85d1bd5

Browse files
authored
[Capacitor v3] use 'registerPlugin' func instead of using registerWebPlugin (#82)
* fix: use 'registerPlugin' func instead of using registerWebPlugin * feat: pass proxy plugin for native (do not pass web plugin object directly)
1 parent 40b999f commit 85d1bd5

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
"author": "CodetrixStudio",
1414
"license": "MIT",
1515
"dependencies": {
16-
"@capacitor/core": "latest"
16+
"@capacitor/core": "^3.0.0-beta.2"
1717
},
1818
"devDependencies": {
19-
"@capacitor/android": "latest",
20-
"@capacitor/ios": "latest",
19+
"@capacitor/android": "^3.0.0-beta.2",
20+
"@capacitor/ios": "^3.0.0-beta.2",
2121
"@types/gapi": "0.0.36",
2222
"@types/gapi.auth2": "0.0.50",
2323
"typescript": "^3.2.4"

src/web.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { WebPlugin } from '@capacitor/core';
1+
import { registerPlugin, WebPlugin } from '@capacitor/core';
22
import { GoogleAuthPlugin } from './definitions';
33
import { User, Authentication } from './user';
44

@@ -132,9 +132,7 @@ export class GoogleAuthWeb extends WebPlugin implements GoogleAuthPlugin {
132132
}
133133
}
134134

135-
const GoogleAuth = new GoogleAuthWeb();
135+
const GoogleAuth = registerPlugin('GoogleAuth', { web: new GoogleAuthWeb() });
136136

137137
export { GoogleAuth };
138138

139-
import { registerWebPlugin } from '@capacitor/core';
140-
registerWebPlugin(GoogleAuth);

0 commit comments

Comments
 (0)