Can PWA access android's NFC capabilities - in 2019? - nfc

We are developing PWA for our app because it's capable of 99% of our needs , however we do need NFC reading capabilities (not writing) and we would hate to abandon PWA and go Native just for this 1 thing
Our purpose for NFC is for reading the serial only. In fact we dont need fancy NFC functions. We just have a text field where the NFC code should be typed in, kinda like how barcode readers work (keyboard emulation)
Is this possible with PWA today?

The Web NFC API has a draft status at W3C. However, it seems to be the case that Chrome for Android has support for NFC, but only in experimental modus.
This means that currently, if you would release your application today, NFC will not generally be supported. However, the fact that Google has it available in experimental modus, seems to indicate it will be more widely available soon.
You can check the status here

For in-house solutions (or solutions where you have full control over the device) you can do it without NFC api in browsers (at least until it is available).
You will need to install Tasker app (paid, about 3 USD), which can create NFC read trigger, which then can open url like yourapp.com/{nfc_uid}. If YourApp is installed as PWA, you can select to open the url in the app instead of browser. This way it will look like the PWA is reading the NFC tag.
To make it work:
1. Install Tasker
2. Add new -> Event -> Network -> NFC Tag. Leave field blank and confirm (or just press back button)
3. Add new Task to this trigger: System -> Send intent
Action: android.intent.action.VIEW
Data: http://yourapp.com/%nfc_id
Extra: com.android.browser.application_id:yourapp
Target: Activity
4. Save
The reason we are not doing it using Task "Open url" is because we do not want to open new tab each time it is triggered.
If you have everything right and you scan NFC tag, your app should load with the NFC UID in url.

I think that you have any solution, if you don't have solution yet, so I recommender check this web site.
https://www.chromestatus.com/feature/6261030015467520#
https://googlechrome.github.io/samples/web-nfc/
to enable NFC experimental on Chrome type chrome://flags on G Chrome Android explorer

Related

how to write nfc NTAG215 cards and read it without an app on iphone

I am interesting in writing an url to NTAG215 cards, so far I have download some apps for Ios tagwriter and NFC tools however once I try to read the card I have to open the app and read it, and my intention is to approach the phone and it will be able to pop up the window that let me open the link.
I have read and search quite a bit online about this but I am confused if this is something that needs to be develop using a sdk or its something the I have sort it out playing with the phone configuration.
any information will be much appreciated.
JL
So iOS does support some background processing of URL's in the correct form.
See https://developer.apple.com/documentation/corenfc/adding_support_for_background_tag_reading
If you look at the NDEF spec https://github.com/haldean/ndef/blob/master/docs/NFCForum-TS-RTD_URI_1.0.pdf and look to only support URI Identifier Code 3 & 4 and possibly not 1 & 2
And from Apple's doc's
Note
Background tag reading doesn’t support custom URL schemes. Use universal links instead.
Definitely not URI Identifier Code 0 (custom URL)
And NXP Tagwriter App seems to default to "custom URL", so try writing the URL using the https:// or http:// from the drop down menu.

Need to convert a legacy safari extension into Safari App Extension. Searching for documentation, starting steps and tutorials on Xcode

I have a legacy safari extension which I need to convert into Safari App Extension to submit into Extension Gallery. I am new to Xcode therefore, not familiar with it's build and run process. I tried looking into official documentation from developer.apple.com but it is so abstract.
Why do we need to create a parent app in Xcode before creating a
safari extension target?
If so what parent app template should I
choose? Cocoa App?
Where I can find starter tutorials on Xcode?
What is the submission process to Extension Gallery?
How can add the extension under development to my safari through xcode for testing?
I heard they need the URL for extension to approval, when we are submitting extension through developer account why to host it on URL?
Any documentation or answers to the above questions would be very helpful. Thank you.
On 2. and 3, I had the same struggles - I wrote up a tutorial on basic style sheet injection in Safari App Extensions here: https://ulyngs.github.io/blog/posts/2018-11-02-how-to-build-safari-app-extensions/
I'm converting the legacy safari extension to safari app extension too and have some answers for your questions:
Because app extension is more as functional extension then safari browser extension and could bring more features to you. And as per Apple says: safari app extension gives more communication and data exchange between Safari and your native app, docs.
But I have no more ideas if you only want an extension for safari why this is only way to do extensions.
Yes, you should use the Cocoa App template. If you don't need the window for your app, you can remove it simply in Main.storyboard or make app as a "service".
A lot of docs from Apple I've read but understood a bit then expected. So I found some youtube channels (they are 2 or more years old but some things seems don't changed) Some vieos here and the Osx Dev Daily playlist on this channel. And of course official swift docs if you select swift for your app as PL.
I haven't read about this, but think it must be submitted with your Cocoa App.
First of all you should to run your app target and only after this you should run your extension target and choose "Safari" in showed window to run in. If you have no the signing at the moment so ensure to enable "Allow unsigned extensions" in Development > Allow unsigned extensions in Safari app.
Don't meet this info, could you share it, pls? (sry, don't have enough knowledges)
Hope, it helps to you!
P.S. also recomend to see the converting docs, but it may be insufficient for converting :)
EDIT: it's seems to be incorrect to remove app window or change the default menus created by Cocoa App template for app submit for App Store. Some people got negative decision of app submit because of menus changes of redundant items or app have poor functionality or has not it at all. So consider to read the submit docs.
Please, share your experience when you'll have success app submit!
EDIT 2: Today I found template in Xcode 10.1 that can be used for Safari Extensions directly. It is as previous workflow (template Cocoa App + add extension target) but there is safari extension target already included
The app window and menu is simplified for developers:
So you don't need work with your app and you can concentrate on extension only.

Chromecast home screen development options?

I've been reading through Google's Chromecast developer documentation and I can't seem to find any developer docs that discuss how to develop customizations for the Chromecast home screen, such as HTML overlays, etc.
There are Chromecast apps available that do show stuff on the Chromecast home screen, such as Dashboard Cast, https://play.google.com/store/apps/details?id=com.rir.dashboardcast&hl=en.
Does anyone know what approaches can be used with the Receiver API to allow this?
You cannot customize the home screen (backdrop); users can change what sort of feeds (images) can be used to be shown there. You, as a developer, do not have control over that and if it seems that some developers have customized that, in reality they have not; they are running an app there (like any other chromecast app).

Is it possible to view output of visual studio cordova project as a web app in browser?

I am using Visual Studio 2015 tools for Apache Cordova for mobile application development on Windows 7.
To build and run my app, I have to choose one solution platform and one target.
Is there any way to view the output on my browser just like a web app with no emulator?
When I press f5, the result will open in a browser in an emulator mode which I choose as system platform and target device. But I want to run my app like a web application, when you right click on index.html and select view in browser.
I look for a project setting or a ‘system platform’ and ‘target device’ value that work like that.
PS:Selecting any windows solution platform and local machine target needs Windows 8 or higher and the build process is failed.
Thank you.
The solution I found for my problem:
I used the url of my output result with emulator: "http://localhost:4400/index.html?enableripple=cordova-3.0.0-NexusS"
and then removed the emulator settings in url: "http://localhost:4400/index.html".
Using this url will cause some popups asking some things. These are for 'cordova.js' script which is referenced in index.html file of cordova project. As we do not need this in browser, commenting the line <script src="cordova.js"></script> from index.html, no dialog will open any more and the project will compile so faster for initial design that do not need cordova.
Now I will use chrome mobile mode (f12-> phone icon) to see mobile view of my app.
#A.M.
The answer depend on your expectations.
If you just want to view the page layout and test some of the associated Javascript, the answer is YES.
If you want to test the plugin libraries and associated JS, the answers is NO.
However, here are some items to be cautious with - either way.
When running your code on a device, you MUST wait for the
'deviceready'. There are not ifs, ands, ors, or buts on this - you
must wait.
You can emulate some of the plugins. This Summer some of HTML5 APIs have become available. If you want to write a shim, you can emulate some plugins with the HTML5 APIs, and use the Phonegap plugins on the mobile device. NOTE: some emulators now support HTML5 APIs.
Not all browsers are equal and not all webview libraries are equal. Cordova and Phonegap both use a webview library with their respective platforms. On Android, it is called Webview. On iOS, it is WKWebview. These libraries are finally starting to get some attention. So Google, Apple, Intel and others are all making competing libraries. *better for us* ;) One new library for Android is called crosswalk. Many developers like it, but it is bloated.
Best of Luck

Sharing Files with other Chrome Extensions using ARC

We have an Android application that we have developed and are testing with ARC. Part of the functionality is to share Word/PDF and other documents with other applications on an Android device and then have them pass the content back to us when done. However, since ARC applications run in their own sandbox instance of Android there are no other applications to share with using the standard intents. I know that Chrome Extensions can message each other, but is there a way to access this functionality from an Android APP running arc. Ideally we'd like to share a document have it open in say Google Drive, and then be able to get it back from there using the standard Android intents. Is this possible, or do we have to look at other ways to accomplish this (i.e. SDKs.)
Update: Here is the code we use to launch external activities to have them open files for editing:
Uri uri = Uri.fromFile(attachmentFile);
Intent intentUrl = new Intent(Intent.ACTION_VIEW);
intentUrl.setDataAndType(uri, applicationType);
intentUrl.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getContext().startActivity(externalActivityIntent);
You can get the file from Google Drive or any other file provider available on the chromeOS using the new intent: ACTION_OPEN_DOCUMENT

Resources