-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(web): supporting .ts
and.js
config, exported types
#114
Conversation
.ts
, .js
config.ts
and.js
config
Any progress with this? |
i'm publish version with this changes see https://www.npmjs.com/package/@reslear/capacitor-google-auth/v/1.1.0 and this pull have breaking change |
Thanks for quick response, @reslear. I just realized that having .js config support doesn't actually fix the issue with configuration for multiple environments, since there is still need for find/replace in some XML's anyway... |
@spaghettiguru yes, you're right, but in my case runtime config helpful partially for native ios android, and big helpful for web p.s. if you testing https://www.npmjs.com/package/@reslear/capacitor-google-auth/v/1.1.0 please write a review :) thx |
@reslear I tested it, but got the error: public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
registerPlugin(com.codetrixstudio.capacitor.GoogleAuth.GoogleAuth.class);
}
} |
According to the description in the issue #116, I adjusted the front-end code, but I encountered another error import { Device, DeviceInfo } from "@capacitor/device";
import { GoogleAuth } from "@reslear/capacitor-google-auth";
const initAuth = async () => {
const deviceInfo = await Device.getInfo() as DeviceInfo;
if (deviceInfo.platform === "web") {
GoogleAuth.init();
}
const user = await GoogleAuth.signIn();
console.log(user);
};
initAuth(); |
please merge this. i'm going to have to switch back to .json config temporarily. |
how to get response type before import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
type Await<T> = T extends PromiseLike<infer U> ? U : T
type User = Await<ReturnType<typeof GoogleAuth.signIn>>
type Authentication = Await<ReturnType<typeof GoogleAuth.refresh>> after import { User, Authentication } from '@codetrix-studio/capacitor-google-auth'; |
.ts
and.js
config.ts
and.js
config, exported types
Merged but still doesn't work with capacitor.config.ts? |
@FY0u11 already working and used in production, use temp repo https://www.npmjs.com/package/@reslear/capacitor-google-auth |
WIP 🚧