svyPhonegap not working on iPhone XS

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:

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]>, 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,

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,

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:

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,

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?

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


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,

Need to comment out as well the FCM plugin:

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: ‘Servoy Mobile’ 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:
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,

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.

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 “:frowning: 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,

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.

Trying the updates from GitHub.
The FILE app is still not work for me. Error on Load:

[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:

[Log] File plugin not loaded.. (cordova.js, line 1731)

The following declaration is in your config.xml?

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/)

Yes plugin is in config.xml and the Cordova-plugin-file folder has a lot of js files.