Advice on making first screen load super fast in React Native app - ios

This is more of an advice question rather than a troubleshooting question. Speed is the focus here. I'm currently working in iOS but obviously planning to build for android.
I have built a React Native app where I am using the react-native-nfc-manager library. The function of the app is simple: read what is on an NFC tag and write to it (the NFC tag) in one tap. There are 3 screens:
The first screen (upon app open) is the NFC scanning screen and it is very simple- just a few components to activate the NFC scanner
NFC tag history screen
Account/settings screen
Screens 2&3 require API calls to some external (AWS) resources. No external API calls are needed for the first screen to be loaded or for the NFC scanner to be used. I need to ensure that this first screen loads as fast as possible on app cold/warm/hot start. My goal is to use RN for as much of this app as possible. As I see it, there are a few options:
use RN to write screens 1,2,3
use Swift/Obj-C to write screen 1, and RN to write 2&3
go completely native.
I really want to be able to reuse my RN code for screens 2&3 at the very least - it doesn't matter how long it takes for those screens to load. I almost wonder if there is way to bundle screens 2&3 separately. I've done some searching/reading and can't seem to find exactly the information I'm looking for so I welcome links/reading materials that may help as well. Please try to compare any suggestions made to the performance of a fully native application, ie. "Option 1 will be just as fast as an application written entirely in Swift." Thank you.

Related

How does Accessibility Inspector read content of an iOS app page?

I am working on accesibility features scanning research and I have a question.
Accessibility Inspector built in the XCode can break down the page of the simulated app into the components and analyze them. How does it retreive the needed information from the app view?
What is algorythm of analyzing another program view displayed?
Is it possible to analyze installed app by another application?
I haven`t found any application capable of doing it when the analyzed app is already installed on the device (unlike Accessibility Scanner for Andoird, which can run on your phone). Are there any restrictions for that?
I will be really grateful for any link or information.
I do not need exact implemintation. I just need an understanding/steps how to do it.
Thank you in advance

How to embed Autodesk Forge Viewer with mobile app?

I was using ionic and angular to develop a mobile app that could display the pdf, image or dwg file within the forge viewer. It works all perfectly on the website monitor, but when I deploy the app in the ios phone and the android phone, I found out that if I open the dwg file and some image file, the app will crash sometimes. Btw, some extension is not supported by ios, such as pushpin extension. It seems that three js works not good in ios.
I also check the document about the "Create iPhone Apps Using Forge Viewer & React Native" in the forge viewer official website. After I follow the steps to build the app with native react and deploy it on my phone, pdf and image file works good but not for the dwg file.
I have experience building apps with ionic but not React Native. Compare to these two frameworks, which one should I pick? If I continue using the ionic framework if there is any way I could use to improve the performance of the forge viewer inside my app? or would it be better to switch to React Native?
For tech questions, how could I avoid the app crash and improve the performance? I checked the A360 app on the app store, I found out that the app is using the offline data, it will download all the data once it opens the file. Should I do the same way?
App Viewer
Technically both RN and Ionic embeds Viewer as external dependencies in WebView so there's no material difference/pros and cons in the approach to embed.
As such I'd recommend to go with the framework you are more comfortable/experienced with - although RN seems to be blessed with a couple of samples but those do little more than scratch the surface when it comes to a real world solution so you can get up to speed with their approach and go from there.
Performance wise yes - downloading the derivatives (SVFs) to the client side would certainly improve load times - you can either see here and here to download, store/package locally and override request handling of WebView to load them (as Viewer only supports http(s) and not file or other protocols) , or cache the resources with Service Worker following here and here.
You can look around SO for other performance related questions - mostly they are about setting the memory options, correct FPS targets, consolidating geometry, selective loading and adjusting navigation options - for specific issues you can post another question or email forge.help at autodesk.com for assistance.
It is okay to open the dwg file less than 1mb very soon, but if the file is larger than 1mb, it will take some time to load and is hard to zoom the viewer.
I'd suggest to download or cache the derivatives (SVF) locally to boost loading performance. I was unable to reproduce any difficulty with zooming - did you set viewport in head meta tag?

Is it possible to prevent an iOS app from being placed on the home screen?

I am developing an iOS app using Xamarin.iOS that should only be triggered by tapping on a URL. Because of this, I would like to prevent the app icon from being placed on the home screen. The reason is, the app will not function properly if they open it from the home screen (it needs some of the data in the URL to load properly). I would prefer to prevent the app from being on the home screen instead of checking whether a link was tapped or not. I know that is possible to do this in Android using the manifest, is this also possible in iOS?
This is not possible whatsoever; the developer has no control as to the placement and visibility of the application, and as such will always be visible on the springboard/home screen.
The best option you have is to show information to the user that explains why opening it from the home screen will not work, if they launch it that way. Most likely though, this will be rejected from the App Store as having no useful purpose. The guidelines are found here (App Store Guidelines), and I think this is what may cause a rejection (emphasis mine):
If your app is not particularly useful, unique, or “app-like,” it doesn’t belong on the App Store.
I'm not finding the documentation I was looking for, but, as far as I know, this is not possible in iOS.
You could maybe have a default url that the app launches with and then use deep linking to launch the app with a custom urls. There are lots of great tutorials on deep linking (launching your app through a url) like
This one or maybe this one

How to create a HTML link to a build.phonegap app?

I have run into several problems with iOS development through phonegap recently, and unusually people around here have been unable to discuss these issues and even together we have (for the first time I have ever seen) not had a single comment or answer for these topics...
See https://stackoverflow.com/questions/14707936/make-a-page-that-redirects-back-to-ios-phonegap-app and iOS broswer data -> Cache & Cookie for Phonegap App / Session?...
However, I have found "solutions" to get around these, but its by no means answers to the issues in question which are still outstanding... just simply doing it a completely different way.
However, despite loosing web-view in phonegap, in an attempt to get around https://stackoverflow.com/questions/14707936/make-a-page-that-redirects-back-to-ios-phonegap-app I now have some issue that are outstanding...
I need to be able to navigate back to my App from the web-system !!!
However, I have no idea how. I have read info on creating URL Schema, but I am not sure if this is even possible through build.phonegap at all... and it seems faily complicated. Does anybody know of a way for iOS safari to do one of two things
Either
Open the app that is running in the background
or
close the current browser tab and navigate back to the app in the background.
The closing tab idea would be good, but not essential
Look forward to everyone thoughts and opinions on this one...
Henry
You can create an url scheme for any application you make yourself.
See tutorial here
It's not as terribly complicated as one would think, and the required objective-c code is minimal.
Once you have done this, you can use your own url scheme to launch your phonegap application from safari with a hyperlink.
This would not close the tab (you could do this with javascript if you wanted to)
but does put safari in the background, and opens your phonegap app.
(whether it is already running in the background or not)
It is even possible to pass data to the app using your url scheme.
It is not currently possible using PhoneGap Build in 2.2 and previous. Potentially a feature top be released in newer versions of Cordova/Phonegap

PhoneGap in regards to App Store approval

I read that PhoneGap is approved by Apple as a framework for building native apps, but I'm not clear on how this does not constitute a "website wrapped as an app," something that Apple specifically doesn't like, as per their App Store guidelines. I'm assuming it is because the JS is contained in the application, rather than running on a remote server?
Any clarification on this issue would be most appreciated.
but I'm not clear on how this does not constitute a "website wrapped
as an app," something that Apple specifically doesn't like, as per
their App Store guidelines.
By this Apple means Apps that simply show a UIWebView that loads a remote website, so it basically just behaves like Mobile Safari, just without the controls. Also they wan't Apps to show at least a UI when the device is not connected to the internet, like in the Facebook App where you can still read already downloaded status updates, view photos etc. That's what a "I just wrap a remote website inside a UIWebView"-App can't do.
PhoneGap Apps have all the resources they need (HTML, CSS, JavaScript) on the device residing in the App's bundle, so using such an App would not depend on network availability and could at least show a UI that tells you to connect to the Internet in order to use the App, or they could display already loaded content (like Facebook, Twitter and so on).
I think that the signature of the binary tells Apple what framework built the application, and since all the supporting files (js included) are included in the project and therefore in the binary, it is a standalone application. That being said, I still think that doing things Natively is the best way to go. I am extremely comfortable with javascript and started out thinking Phonegap was the way to go for me. I did a couple of projects with it and then decided to take the plunge and learn Objective-C. That worked out so much better for me. No dependency on a third party framework and I wish that I had started that way.
Sometimes the easy way out just hurts ya in the end IMO.

Resources