Meteor OAuth is taking a long time over LTE / 4g / 3g - oauth

I recently released LinkedIn OAuth on my Meteor mobile app. I'm running into long 12-20sec login times on LTE/4G/3G. On wifi, login happens around 1 second.
Some users are reporting that the loggingIn spinner spins for 10 seconds and then stops, but I can't replicate that on my phone.
Has anyone had issues with this before? Any ideas on how I can speed this up?

For future reference here's how you can publish it with fast render:
// serverside
Meteor.publish("loginConfig", function(){
return Accounts.loginServiceConfiguration.find();
});
// client route
this.route('home', {
path: '/', fastRender: true,
waitOn: function(){
return Meteor.subscribe('loginConfig');
}
});

Related

indexedDB.open() takes around 10sec on iOS Safari

I have an indexedDB database used in a web app on my iPhone.
Lately it started to take more time to start. After diagnosing this case for some time I've found that it happens because of indexedDB.open() running for 10+ seconds.
Here is a little code example
var db;
var promise = utils.promise();
var openRequest = indexedDB.open(this.dbName, this.version);
openRequest.onsuccess = function(evt) {
db = openRequest.result;
promise.resolve();
};
openRequest.onerror = function(evt) {
promise.reject();
onError(evt, 'Database open');
};
Database itself didn't change lately so much. Also I don't have lots of data. It has around 300 records.
Any idea how to diagnose such an issue?
UPD may be related https://bugs.chromium.org/p/chromium/issues/detail?id=402980
Apparently it was a result of iOS update (from 11.1.* to 11.2.*).
I have my web app added to the Home Screen. And as far as I understand when you do iOS updates the web app container is moved to a new iOS environment but conserves some features from the original iOS version (probably something related to WebView used for web app but I am not sure).
So I have added my web app to Home Screen again and it starts without delays.

In app browser event is not working in iOS device

I am working on the hybrid app
For Paytm integration, I used the in-app browser method
var browser = this.iab.create('http://url?ORDER_ID='+result.orderid+'&CUST_ID='+this.cust_id+'&TXN_AMOUNT='+result.total,'_blank','location=no,hardwareback=no,zoom=yes');
browser.on('loadstop').subscribe((event) => {
if (event.url.match("returnprocess.php")) {
setTimeout(function(){
browser.close();
let loader = this.loadingCtrl.create({
content: 'Back to order, wait a minutes'
})
loader.present();
loader.dismiss();
}, 5000);
//then push to next page
The above code is working fine on Android device. But in IOS device it is not returned to APP.
I googled a lot. But I couldn't find the right solution. Please help me. Thanks

IONIC2 - app gets killed after some time even when using Background Geolocation

I have an IONIC2 app, which needs to wake up every morning at 8 AM for 20 minutes to send user reminders based on the user's geolocation.
I am using this plugin (which uses IOS significant changes API to monitor changes in user's location)
https://github.com/mauron85/cordova-plugin-background-geolocation
The problem:
The app doesn't get killed when I close the app and the background geolocation works for me fine for some time. I have tested upto an hour. But when I wake up next morning, I find the app was killed by IOS.
I know there is another plugin to keep the app running in the background https://github.com/katzer/cordova-plugin-background-mode, but I have read tons of complaints from people that it will cause your app to be rejected by the AppStore (In fact, the plugin has a disclaimer to the same effect too).
For waking up the app tomorrow, I simply set a setTimeout
setTimeout(function(){
console.log('waking up');
self.helper.scheduleLocalNotification('Hello World', 'Good Morning', 10, "");
self.ionViewDidEnter();
}, wakeupinMilliSeconds);
Here is my geolocation code:
setupBackGroundGeolocation(){
let config = {
desiredAccuracy: 100,
stationaryRadius: 50,
distanceFilter: 100,
interval: 5000,
pauseLocationUpdates: false,
debug: false, // enable this hear sounds for background-geolocation life-cycle.
stopOnTerminate: false, // enable this to clear background location settings when the app terminates
};
BackgroundGeolocation.configure((location) => {
console.log('[js] BackgroundGeolocation callback: ' + location.latitude + ',' + location.longitude);
this.currentLocation.lat = location.latitude;
this.currentLocation.lng = location.longitude;
Promise.all([
//I do some calculations here.
]).then(d => {
// IMPORTANT: You must execute the finish method here to inform the native plugin that you're finished,
// and the background-task may be completed. You must do this regardless if your HTTP request is successful or not.
// IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background.
BackgroundGeolocation.finish(); // FOR IOS ONLY
});
}, (error) => {
console.log('BackgroundGeolocation error');
}, config);
// Turn ON the background-geolocation system. The user will be tracked whenever they suspend the app.
BackgroundGeolocation.start();
}
I don't use this plugin but had same symptons. I couldn't figure out what was wrong: no error messages, no clues but app kept closing after a few hours.
I guess there was something messed up after installing and uninstalling so many cordova plugins. Now the app is much more stable. I removed and added platform. That seemed to do the job.
I've been reading about ionic2 and performance. Among so many reasons, a possibility about low performance and crash is related not to unsubscribe from observables. Read about async pipe and .unsubscribe observables when component is destroyed ngOnDestroy
Another problem i found was a very basic mistake developing in angular. I loaded everything in the app module so this required lot of memory to load the entire app at once. I guess with slow terminals that can affect more. Anyway, basic angular concepts as .module files should be understood.

PhoneGap - Cordova / Application freeze during 5 seconds when resumed through app icon

I own an AngularJs app that I converted into a native app through Cordova.
The whole works on iOS (iphone), however I've just noticed that if I put the app on the background, then reopen/resume it, the application sometimes "freezes" for about 5 seconds then works.
No scrolling, no click events, for 5 seconds.
Any known reason to this? How to avoid it? It's very frustrating.
I found the code causing the issue:
document.addEventListener("resume", function () {
$rootScope.$broadcast('retrieveAllNotifications', null);
}, false);
So, according to the documentation:
Interactive functions like alert() when the resume event fires will
need to be wrapped in a setTimeout call with a timeout value of zero,
or else the app will hang. e.g.
So I transformed to:
document.addEventListener("resume", function () {
$timeout(function () {
$rootScope.$broadcast('retrieveAllNotifications', null);
}, 0);
}, false);
but it still hangs.
However, when I remove the broadcast, it works.
How to fix it? Increasing the timeout to 1 second for instance?
Actually, I noticed that I retrieved more than 500 notifications that are displayed (though hidden) in HTML.
What I've done is to delete a lot of notifications, and I noticed no more freeze.
It was just too heavy for the phonegap app to display 500 notifications at once without freezing.

Blackberry Phonegap geolocation Issues

I'm having a problem when testing the geolocation API using the Blackberry devices. I'm using Phonegap 1.2.0 to build my app and I use the common HTML 5 geolocation API to get the location information.
I'm testing using Bold 9900 device on wi-fi and rarely I could get the lat long. Most of the time it returns time out error. Using the simulator, I get everything running smoothly, my google map shows up just fine. Even when I test using other devices like Torch 9860 on wi-fi, I have to retry many times until I get the lat long. On Bold 9900, it just time out all the time. I checked the device location service from the Settings and I actually could see that the device GPS working, the lat long were detected fine. This must be something wrong with the Blackberry devices, the exact same codes I have running fine on iPhone.
I tested using the SIM card as well to make sure is not the wi-fi causing the problem, but the same thing happens. It just can't get the lat long right away, only when you're lucky.
As recommended by Blackberry Webworks, I do not need to specify permissions or feature elements inside the config file. My code is just as simple as this one:
navigator.geolocation.getCurrentPosition(success, error, { maximumAge: 600000,
timeout: 10000, enableHighAccuracy: true });
var success = function(position) { // do something };
var error = function(e) { // do something };
Can someone help me on this?? Before I throw my Blackberry devices...

Resources