Phonegap Backbonejs works on simulator not device - ios

Using phonegap 3.1.0, Xcode 5.1.0, and iPad 2 with iOS 7.0.1
I am writing a app for iPad and Im having some issues that seems very inconsistent in illogical.
The app works fine in the simulator
The app does not work on the device
The app starts working on the device once I remove the line localStorage: new Backbone.LocalStorage 'foo'
This is the example Collection
class Channel extends Backbone.Model
idAttribute: "ChannelID"
class Channels extends Backbone.Collection
idAttribute:"ChannelID"
initialize: =>
#model = Channel
localStorage: new Backbone.LocalStorage 'fc.channels'
As soon as I remove the localStorage line, it works. this happens only on the device, it works as exspected in the simulator, its as if the device is slow or something and does not load everything, allthough the deviceready is triggered
console.log Backbone.LocalStorage does not return anything
UPDATE:
I found that backbone.localStorage-min.js is not loaded on the device! WHY!!! At least now I know why its not working, but why the file is not loaded who knows!
UPDATE 2:
I got it working by changing the name of the backbone.localStorage-min.js to something else like backbonelocalstorage.js
This is the most ridicules thing I have ever come across!

Related

Xamarin iPad app never gets past default blue xamarin logo screen

(Microsoft Windows 10 VS2022)
I have a basic Xamarin App that I have been working with and deploying on my Android Phone. (works great on Android.)
I created a Apple Developer Account and added those details into Visual Studios 2022.
I plugged in an iPad and started debugging.
The app launches and Hot Reload at the bottom says Launch succeeded.
But the screen only shows the Blue default Xamarin page that initially loads as default. It never goes past that - I don't get any errors. And all my breakpoints set at all spots on the App.xaml.cs page and AppShell.xaml.cs page never get triggered.
Is it a navigation issue with my AppShell.xaml.cs?
Or what could I be missing? Where do I look to see where it is hanging?
public App()
{
MainPage = new AppShell();
}
public partial class AppShell : Xamarin.Forms.Shell
{
public AppShell()
{
InitializeComponent();
Routing.RegisterRoute(nameof(MainPage), typeof(MainPage));
}
}
It appears I may have found the solution.
I updated the iPad (only one revision back; it's at 15.4 now)… I don't think that was the issue.
I think I had not "Built" the app prior to debugging. This resulted in a bad version being stored on the iPad. (You must delete the app with each change.)
To help - If you have a Windows machine developing on Apple iOS:
When developing on a Windows (win) 10 machine. You have to do a full build First!
Build - Build Solution.
Then debug/deploy on apple device.
Every change made - you must delete the app off the Apple device, Build, and re-deploy. This is the only way I can get it to work.

UnityAds in iOS using wrong game id, and not working

I am using UnityAds in my mobile game, to show a banner and a rewarded video.
In the editor and in Andorid works fine.
However for iOS it doesn't work, i took the logs and i noticed that for iOS is using my android gameid, this i have no idea where it comes from, i searched every file in my project, i never reference the android gameid, just the iOS one.
So it is clearing taking the id not from my initialization but from some sort of cache, anybody has an idea where is taking the gameid from? thanks
Btw
I am using Advertisement package from package manager.
You can open manually Project Folder\ProjectSettings\UnityConnectSettings.asset in text or code editor, then find
UnityAdsSettings:
m_Enabled: 0
m_InitializeOnStartup: 1
m_TestMode: 0
m_IosGameId: <---- THIS ONE
m_AndroidGameId:
m_GameIds: {}
m_GameId:
and edit it

Phonegap iOS App Crashing on iPhone 6 when loading contact photos

I have a phonegap application that crashes on iPhone6 with iOS 8 (It works fine on iPhone6+) when calling phonegaps contacts.find method. This only happens with the 'photos' filter. When it gets to this part of the code, the app immediately crashes. I remove the photos filter, and everything works fine.
Here is the code that I am using:
navigator.contacts.find(['name', 'phoneNumbers', 'photos'], function (contacts){ }, function (error) { }, options);
I am using the latest version of phonegap.
Any help would be greatly appreciated.

localStorage cleared on app restart with Cordova 1.7 and iOS 5.1.1

From my extensive reading, the iOS 5.1 localStorage/WebSQL behavior change that Apple instituted has been fully rolled into Cordova 1.6.0.
However, while running on my (new) application on Cordova 1.7.0 and iOS 5.1.1, I am still seeing ugly, incorrect behavior.
I use window.localStorage to store and retrieve data. E.g.
window.localStorage.getItem("activeFormId")
window.localStorage.setItem("activeFormId", formId);
These work flawlessly during the same session of the Cordova-based app. If I background the app with the main iOS button then resume, that usually works as well.
However, the moment I kill the application (double-tap, long-press, tap the red circle) and relaunch, all localStorage data is lost. I have verified this with jsconsole.com as well.
Are there additional steps I need to take to ensure the persistence bug fixes are working? Any help is greatly appreciated.
Try using 1.7 - I had a similar issue and once I upgraded to 1.7 everything worked like it used to.
Try using localStorage vs window.localStorage syntax.
Also set what ever you're trying to call as a global variable...
var globalVar;
function onDeviceReady(){
globalVar = localStorage.getItem('something');
}

PhoneGap + Sencha2 screen blank

I've started a project in PhoneGap which will utilise Sencha Touch 2.
I tried to change the app name from 'app', since I've heard that conflicts with PhoneGap on Android devices. I altered app.js to main.js and that worked, but then I tried changing the Ext.application.name. All I got was a white screen after the loading splash, even with the old name Sencha. Debug console shows nothing at all happening, and the document <body> was empty. This happens with both sencha-touch-all.js and sencha-touch-all-debug.js. Test device is an iPad 1G running iOS 4.3.5.
Aside: To debug this issue, I set up weinre on my Mac and added the appropriate <script> tag to index.html. After making that change, though, the app didn't even launch. It hung on the PhoneGap splash png and I got this message from gdb-remote:
error: failed to launch '<app URI>' -- failed to send the qLaunchSuccess packet
The only reference to that message besides its definition in gdb-remote source that I can find is here, and it's unrelated. I managed to get the issue to go away by restarting the iPad and removing build intermediates.
SOLVED: The issue here was a missing value in the Ext.application definition (key with no associated value), so the whole app definition probably tanked as a result of that. Hence blank screen.

Resources