Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230426

Retrieving data from the hosted PWA

$
0
0

I just want to use it - I don’t mind whether it’s from static or an instance but since I can’t see any way to get the instance that Capacitor magically creates during initialisation (e.g. below), I figured that a static call might be an option.

...
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{

      // This is the only place MyPlugin is referenced so I have
      // no idea how to get the relevant instance after this point
      add(MyPlugin.class);

    }});
  }
...

Thanks for the suggestions. I think I need an activity “request” rather than a result but I’ll dig into the Camera plugin code in case that provides inspiration or even just a better understanding of these terms.

The watchPosition example looks interesting; so does the CallbackID approach used in the BackgroundTask plugin since that’s similar to what I was thinking might be my implementation approach if Capacitor doesn’t offer a generalised communication method that keeps track of callback IDs across asynchronous system-initiated events/activities/messages. I’m increasingly thinking it does not offer this feature because otherwise why would the BackgroundTask API require the hosted web code to manually track the callback ID and pass it back to the finish method when its async work is complete? I’ve run out of time today but will keep investigating and hopefully get my head around the API soon.


Viewing all articles
Browse latest Browse all 230426

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>