How to get purchase data with Codenameone - codenameone

Is there any way to get the purchase data for iOS? Chen tipsed me that there is Display.getInstance().getProperty("lastPurchaseData") for Android, but i wonder if this works for iOS purchases too or if there is another way to access it?

Isn't the wasPurchased API what you are looking for?

Related

What is the best option to create share button? (react)

I saw a lot of option in order to create share interaction with users:
Web share API: https://www.w3.org/TR/web-share/#sharedata-dictionary
It seems compatible with Progressive-Web-App, but it's not well supported by firefox (https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share#browser_compatibility)
Simple Sharer: https://reactjsexample.com/a-javascript-framework-to-share-url-to-social-media-sites-like-facebook-twitter-reddit-whastapp/
If I understood well, it doesn't work for mobile, am I right?
react-share: https://reactjsexample.com/social-media-share-buttons-and-share-counts-for-react/
Seems to work on every browser, but I don't know if it's PWA-friendly. Seems to be the best option, but I'm not sure... The last update was 1 year ago (https://www.npmjs.com/package/react-share) so maybe it will not be maintained through times...
What do you use for your app? What do you recommand?
Do you know better alternatives?
My need for the App is to share URL through social media or mail/text or ??? etc. No file in theory. And I'd like to have adapted preview on social media when the user share something.
I have used react-share personally and it was unable to open some of the apps in mobile like whatsapp, etc.
The workaround is deep-links.
if user is using a smartphone or a tablet (we can easily get this using navigator.userAgent) then you can use the app based deep-links otherwise the traditional way in which you can redirect user to a new web page.
Some of the examples:
Whatsapp: https://faq.whatsapp.com/563219570998715/?locale=en_US
Instagram: Answer is already given here
NOTE: deep-link works if the user has installed the application on desktop as well (never tried for macOS but for windows and ubuntu it works)
After edit:
You can use emailto: in href while writing <a .../>.
example:
Share this link
For more reference about mailto please visit this MDN doc: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href

Building find my phone website with Reactjs

I have an idea of building a travel/security mobile app connected with website, and besides other functionalities i should be able to find my phone on a map... similar to apple's iCloud web. Is that possible in Reactjs?
Yes. that is possible. There are many packages which gives the exact location of user.ex:- react-geolocated. Every time when the users location is updated make an api call to save in the db. and show the similar changes in other side (who is tracking the location).

Ionic Offline MAP

I am working on a hybrid mobile app using ionic. I have developed all feature of app but One of the features I need is offline google map. I want to get lattitude and longitude of user when there was no internet and after reaching in interent zone it threw data using web API.
Is there a way how to do it? I want it for Android and Ios both.
If your issue is only getting the user location, that can be done with no need for internet. Instead, you can use GPS to get the location, and that can be specified by some options when you are getting the location, depending on what library you are using.

How to get website to interact with phone?

Is there any way to get my website to interact with my Phone?
I have made a website that acts as a chat room. Using AJAX, PHP, Jquery and the usual.
But I was wondering if there was anyway for the phone to react to a new message?
I have looked into maybe using Java Applets.
And the possible ways for the phone to react. I don't know what would be the easiest... Maybe open up the web app if the phone is off it?
I am more interested in this for the educational purpose. So please don't slate me.
You would need to mention more details here, like which phone do you have?
You could send an SMS text message to your phone, that would be like an alert.
Regarding options of getting the app to open, that's probably more possible on the Android platform. Your app could have a background checker, or use the push messaging to push a message to your phone.

Can I return to a mobile site after a phone call from a tel link?

I have a mobile site where the user can call someone via a tel link. I'm looking for a way to bring them back to the mobile site after the call ends. I've found solutions for native Android and native iOS but not for this use case.
The actual answer to this question is no, tel: URIs do not support any way of taking visitors back to your website after the call has ended.

Resources