forked from MapComplete/MapComplete
Android: Small fixes to landing page and passthrough
This commit is contained in:
parent
baa7379fbf
commit
77f4bc84aa
12 changed files with 55 additions and 31 deletions
|
|
@ -14,9 +14,11 @@ const DatabridgePluginSingleton = registerPlugin<DatabridgePlugin>("Databridge",
|
|||
web: () => {
|
||||
return <DatabridgePlugin>{
|
||||
async request(options: { key: string }): Promise<{ value: string | object }> {
|
||||
console.log("Android polyfill got request for", options.key)
|
||||
if (options.key === "meta") {
|
||||
return { value: "web" }
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -65,6 +67,12 @@ export class AndroidPolyfill {
|
|||
console.log("Registering back button callback", callback)
|
||||
DatabridgePluginSingleton.request({ key: "backbutton" }).then(ev => {
|
||||
console.log("AndroidPolyfill: received backbutton: ", ev)
|
||||
if(ev === null){
|
||||
// Probably in web environment
|
||||
return
|
||||
}
|
||||
// We have to re-register every time
|
||||
AndroidPolyfill.onBackButton(callback, options)
|
||||
if (callback()) {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue