-
Notifications
You must be signed in to change notification settings - Fork 34
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
Capacitor: Android: LeapChat login and WS connection work!!! 🎉 #326
base: capacitorjs
Are you sure you want to change the base?
Conversation
if (Capacitor.isNativePlatform()){ | ||
authUrl = "http://192.168.1.247:8080/api/login"; | ||
if (Capacitor.isNativePlatform()) { | ||
authUrl = "http://10.0.2.2:8080/api/login"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably create global constants like NATIVE_BASE_URL
or whatever, but I've hardcoded this for now.
import { Capacitor } from '@capacitor/core'; | ||
|
||
let wsUrl = `${window.location.origin.replace('http', 'ws')}/api/ws/messages/all`; | ||
if (Capacitor.isNativePlatform()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did what was quickest to get something working, but we should probably do this conditional once, in one place, and define what are effectively global constants which we then export, then import in places like this.
But... IT WORKS!!!
...for easing testing now and to add to conditional logic soon ™️
Closing this because @jimmcgaw already merged these commits into |
I used document.location.hash to store the passphrase of the current room, even in Capacitor And I used localStorage["roomList"] to store the list of LeapChat rooms the user has visited TODO: Make it so clicking on another room you already visited takes you to that room
…le, not $funky-purple
switch rooms
QR code on invite screen
No more ridiculous error: ionic-team/capacitor#2183
The emoji image is broken but WHO CARES!!! All these work now:
/api/login
(and turn intoBlob
to pass to miniLock) => Successful login!