svyPhonegap not working on iPhone XS

Home for older / inactive topics

svyPhonegap not working on iPhone XS

Postby pbdavis » Sun Sep 01, 2019 11:55 pm

I have svyMobile from GitHub partially working on my iPhone. For example, the Table and Charts work correctly. But, none of the Phonegap device examples work. Here is the error output trying the upload image:
Code: Select all
Error while executing client side code. Please see browser console for more info. Error: ReferenceError: Can't find variable: Bridge (Form Context: imgs_btn), JSEvent(type = action, source = Component: <'button_531' of parent FormUI for FormController[form: imgs_btn, fs size:0, selected record: null,destroyed:false]>, formName = imgs_btn, elementName = button_531, timestamp = 2019-09-01 17:34:31.271,modifiers = 0,x =107,y = 665,data = null)


I'm using the appTemplate.zip from the PHONEGAP Getting Started guide on the GitHub Servoy/svyMobile wiki.

Can anyone help me get the iPhone devices to work with Servoy Phonegap plugins?

Thanks,
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA

Re: svyPhonegap not working on iPhone XS

Postby tnguyen » Wed Sep 04, 2019 6:46 pm

Hi,

It looks like the problem with the client side bridge.js file. Which is included in the appTemplate.
Can you give me more input about how you are going about creating the binary for installation on your IOS device?

In particular:
1. Did you go through Phonegap Cloud build process?
OR
2. Did you try to build directly from Xcode using the phonegap CLI?

If you can also provide a copy of your IPA binary that was generated, I can review it.

Thanks,
tnguyen
 
Posts: 16
Joined: Mon Sep 29, 2014 8:40 am

Re: svyPhonegap not working on iPhone XS

Postby pbdavis » Wed Sep 04, 2019 7:25 pm

Hi Tuan,

I've read through all the svyPhonegap issues on the forum and it looks like others had the same problem but no one posted any solution.

I'm using Phonegap Cloud build. Uploaded your appTemplate.zip with modifications to run svyMobile solution in a local/private network. Debugging in Safari it crashes on calls to Bridge.x. For example, exception occurs when using camera at:
Code: Select all
Bridge.executeMethod(getPicture, null, [successCallback, errorCallback, options]);


@tnguyen Could not attache IPA file. Tried changing the extension to multiple things, exe, bin, jpg. But it would not allow me to upload the file.

Thanks,
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA

Re: svyPhonegap not working on iPhone XS

Postby tnguyen » Thu Sep 05, 2019 7:13 pm

Hi,

thanks, for the attachment, it looked OK, but there were some extra files that probably didn't need to be there (index.html, duplicates)

I've updated the wiki a bit, as the template included in the deployment guide is a bit out of date now I guess, and was meant for more generic use anyhow.

I also included a new template at (https://github.com/Servoy/svyMobile/wiki) that's more geared for this specific solution. You will need to modify it a bit if you are not looking to implement the push notification feature.

In terms of testing, are you able to get the build on a real device or is this testing through simulator?
tnguyen
 
Posts: 16
Joined: Mon Sep 29, 2014 8:40 am

Re: svyPhonegap not working on iPhone XS

Postby pbdavis » Thu Sep 05, 2019 9:02 pm

Yes I am running on real iOS device. That is how I found that the Bridge was not working.
I tried removing the two references in config.xml
Code: Select all
<!-- <resource-file src="google-services.json" target="google-services.json" /> -->
<!-- <resource-file src="GoogleService-Info.plist" /> -->

But I guess there is more that has to be modified because when I try and open the app on my phone it crashes after I say no to push notifications.
What more do I need to do to NOT use push notification feature and test that the camera is now working?
Thanks,
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA

Re: svyPhonegap not working on iPhone XS

Postby tnguyen » Thu Sep 05, 2019 9:37 pm

Need to comment out as well the FCM plugin:

<plugin name="cordova-plugin-fcm-with-dependecy-updated" />
tnguyen
 
Posts: 16
Joined: Mon Sep 29, 2014 8:40 am

Re: svyPhonegap not working on iPhone XS

Postby pbdavis » Thu Sep 05, 2019 10:30 pm

Ok, that fixed the crash problem.
But, my svyMobile still will not work with the devices. I get the same error when it calls Bridge.executeMethod().
I did test with your svyMobile at: 'https://svymobile.servoy.com/solutions/svyMobile/index.html#main' and the camera works.
I downloaded svyMobile from: https://github.com/Servoy/svyMobile. Only made branding changes.
I'm using Servoy Version: 2019.6.2.3504 and running from Tomcat. I changed the iframe to use my version: <iframe id="iframe" src='http://192.168.1.44:8085/svyMobile/solutions/svyMobile/index.html#main' frameborder="0" style="width:100%;height:100%; display: block; position:absolute;"></iframe>
The Tables and Charts work fine but not the camera, location, etc.
Any ideas on how to fix the Bridge.executeMethod() problem?
Thanks Tuan for your help,
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA

Re: svyPhonegap not working on iPhone XS

Postby tnguyen » Fri Sep 06, 2019 12:27 am

Perhaps it is an issue with the export of the solution to tomcat. When creating the WAR file, you are selecting all services for svyphonegap?

One thing you could also try is to point iframe src directly to Servoy developer client URL as well. If you are running on a local network, it may be easier to debug.
tnguyen
 
Posts: 16
Joined: Mon Sep 29, 2014 8:40 am

Re: svyPhonegap not working on iPhone XS

Postby pbdavis » Fri Sep 06, 2019 1:55 pm

AWESOME! That was the problem.
When exporting the WAR file make sure you add the svyphonegap--phonegap and svyphonegap-device as exported services in the Select services to export page. These two were not selected.
Now the media/camera, network and fingerprint are working.
Location errors with ":( NO API KEY LOADED YET...". I assume this should be expected since I have not set any google maps API key.
FILE app does not appear to work. Not sure I will need this feature. I can debug later if need arises.
Thanks for all your help,
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA

Re: svyPhonegap not working on iPhone XS

Postby tnguyen » Fri Sep 06, 2019 3:18 pm

that's great.

Yes, please test again with a API key for location.
For the file app, there is a new update from source that should resolve this.
tnguyen
 
Posts: 16
Joined: Mon Sep 29, 2014 8:40 am

Re: svyPhonegap not working on iPhone XS

Postby pbdavis » Fri Sep 06, 2019 5:02 pm

Trying the updates from GitHub.
The FILE app is still not work for me. Error on Load:
Code: Select all
[Log] Error calling function function readFromFile(fileName, dir, cb, err) {
(cordova.js, line 1731)
                var pathToFile = cordova.file[dir] + fileName;
                window.resolveLocalFileSystemURL(pathToFile, function(fileEntry) {
                    fileEntry.file(function(file) {
                        var reader = new FileReader();
                        reader.onloadend = function(e) {
                            cb(JSON.parse(this.result));
                        };
                        reader.readAsText(file);
                    }, function(e) {
                        err(e);
                    });
                }, function(e) {
                    err(e);
                });
            }: undefined is not an object (evaluating 'cordova.file[dir]’)

Error on Save:
Code: Select all
[Log] File plugin not loaded.. (cordova.js, line 1731)
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA

Re: svyPhonegap not working on iPhone XS

Postby tnguyen » Fri Sep 06, 2019 7:44 pm

The following declaration is in your config.xml?
<plugin name="cordova-plugin-file" spec="^4.3.3" />

The error is saying that the file plugin was never loaded on the binary for whatever reason. if you can send a copy of your IPA file I can review it. Or you can extract it out yourself and look to see if the plugin is there. (under Paylay/appName.app/www/plugins/cordova-plugin-file/)
tnguyen
 
Posts: 16
Joined: Mon Sep 29, 2014 8:40 am

Re: svyPhonegap not working on iPhone XS

Postby pbdavis » Fri Sep 06, 2019 10:01 pm

Yes plugin is in config.xml and the Cordova-plugin-file folder has a lot of js files.
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA


Return to Archive

Who is online

Users browsing this forum: No registered users and 1 guest