Here is my issue, I am using Bootstrap (twbs:bootstrap), font-awesome (natestrauser:font-awesome) and Avatar (utilities:avatar).
When I load my application in a desktop browser, all assets load fine.
When I load my application in a mobile browser, all assets load fine.
But when I load my application in the compiled (Android) app, font-awesome and Avatar don't load their assets. The reason I am targeting them is they are both reliant on contacting outside sources. font-awesome is served off of a CDN and Avatar retrieves avatars from social networks. I know I can package font-awesome but I can't do the same for avatars so I need to figure this out.
I have looked to see if Meteor does something odd like sandboxing the app to prevent outside contact but I can't seem to find any mention of these kinds of issues. Is there a default security settings that I can set where it would allow my app to 'contact' whitelisted sites? It would be absurd but it is Meteor after all.
I figure someone more knowledgeable in Meteor can point out my error.
There is no code for font-awesome (besides using CSS classes) and there is really no specific code for Avatar besides {{> avatar ... }}
Thank you in advance!
Note, as of 5/30/2017: Please skip to EDIT 2 below unless you want to read the very long and confusing ramblings of my former self. Thank you.
Okay, I was right but not necessarily right about who was causing what (I was kind of right). The reasoning behind it makes sense so I am thankful for that.
Here is what I've determined. Cordova has a whitelist under /res/config.xml where URLs are whitelisted and only those URLs are the only URLs allowed outside of the application.
But, if you try to edit config.xml it will be overwritten by Meteor on build which indicates this config is governed / overwritten by Meteor.
I searched around and found a few things: Meteor / Cordova, Meteor. The second article gives the solution. You must use the package browser-policy to whitelist what URLs you want.
After installing browser-policy, you must include them in a file in /server. I tried installing them inside a if(Meteor.isServer) block outside of /server but it didn't work.
Hope this helped! I couldn't find anything similar to this and I presume others will run into this road block as well
EDIT: This will only fix it for desktop. For my issue, I had to create a top-level file called mobile-config.js and use config settings from this page to whitelist URLs. This change happened in Meteor 1.0.4
EDIT 2:
Here is it said more clearly: You must whitelist all outside URLs that you want to contact inside of mobile-config.js
For instance, if you want to contact google.com from your mobile app, you would add
App.accessRule('https://www.google.com')
Thankfully Meteor has fixed their extreme documentation issue and has now included this on the official documentation here
Related
Prerequisites: Got a working app from a friend who needs some changes made. They were outsourcing and now want to internally manage it.
I come from a web and game dev background, so Android/IOS development is new to me, but a lot of the principles seem to be the same.
I got the project onto my device, installed all of the dependencies, and fixed all of the file paths.
The app successfully builds, and I have my virtual Android device running it great!
However, my buddy wants some really simple layout changes, and for the life of me, I can't find where to just edit the home screen layout. I was trying to solve my issue from a web dev approach, by grepping where the logo screen is used in the app, but those files seem to just load a white "background" layer, and not the entire composed page?
I'm missing something really silly here, and I just want to ask a real person on here, instead of digging through documentation and trying to word a condensed question in a Google search.
Here are my condensed questions: How can I just edit the home screen of my app in Android Studio? Where can I find the full home page file to view the entire layout, and not just a fragment?
Edit: The app also utilizes the Flutter SDK, which may explain why I have been having trouble with layout edits. I'm going to look at it again after work today, and hopefully answer my own question. I appreciate the help so far!
Edit 2: After going back to the app with a different approach, I found out my project had defaulted to the "android" sub folder of my master, and wasn't showing any of the Flutter .dart documents. After going up one folder directory, I was finally able to access that Main.Dart file with the display information.
I was able to mount it for inspection, but its saying my emulated device isn't supported. I need to look at it when I have time tonight, and may need to ask a separate question for it. I have my project sdk set to Android 33, and my virtual device is set to Android version 33. I searched around Stack, with a few people with reporting similar issues. I tried following their solutions, but it didn't seem to work.
This is my first post on SOF. OK, let's get to the merits...
Im quite new in Phonegap and mobile applications world but i have some expirience with developing in PHP, C#, JS... but in Phonegap iam stuck in early stage.
I download Phonegap app for windows to testing apps, this software create for me fresh project.
Now i add to index html: <img src="http://domain.com/img.png" />.
In desktop phonegap image is visible but after build i see crash link to image icon. I tested this on Andy emulator and on my HTC ONE - the same effect.
I tryed with jquery link, api connection, nodejs+socket.io external resources in my app, in the next step with additional attributs in html markups, in the next step i used many different config.xml combinations (changing/deleting sections with domains ACL).... i have only one configuration file. ( i builded .apk on adobe web page)
...and I still have this problem.
What could be the problem ? What should I check? how should I debug/test ?
thank you in advance and sorry for my English .
try after Addind <access origin="*" /> in your config.xml file
I had this line in my first approach in config.xml and i check this position witch , domain.com, domain.com, domain.com/picture.png and with option "subdomains" ... and this is not issue in this case.
thanks!
I created a hybrid project which creates a default 'Hello Worklight' page which successfully runs on the android emulator... Now i replaced the default HTMl page with a different page along with its css and javascript folders... I rebuilt the project... It builds without any errors... But when the apps launches in the emulator....the app is just stuck on the IBM logo... I can see no errors in the logcat, that is why i cant figure out whats the problem... Do i need to modify something when i replaced the default HTML age? Help please....
You cannot simply "replace" the contents of index.html with some other content.
The file MUST contain the following:
Reference to css/main.css in the HEAD
References to the following in the BODY
js/initOptions.js
js/main.js
js/messages.js
Without these (and especially initOptions.js and main.js), the app will indeed get stuck on the splash because you will fail to load the Worklight framework, so nothing will work...
Instead, you need to ADD to it (additional references, content, etc).
Explain what you're trying to accomplish...
My real problem is that I need to get youtube videos to play from my app but I can't seem to get it to work... all my research has brought me to this point (hence why I am asking):
As documented here in order to allow external content to open in an iFrame with phonegap you need to modify phonegap.plist.
I've been using their "Build" service which allows you to just add a .zip file and it complies everything for you (spitting out complied code in different formats)
Is there a way to edit phonegap.plist and still use the "Build" service?
Is there a way to edit phonegap.plist and still use the "Build" service?
No, although you can configure some of the items that end up in the phonegap.plist through a config.xml (see docs), the ExternalHosts is not one of the current configurable options.
Also see this related discussion on their feedback forum.
I just upgraded to PhoneGap 1.0 and jQueryMobile Beta 2 and it seems like file:// navigation is totally borked. I've posted a super stripped-down 2 page example for Android 2.2 here: https://bitbucket.org/uhlenhuthm/pgdemo/overview
DETAILED PROBLEM DESCRIPTION:
I've created a very simple 2 page test application in PhoneGap 1.0 for Android. In my assets/www folder, I have two files: index.html and hola.html. PhoneGap loads the index.html file which contains a single button (see below). Clicking on the button SHOULD load a new page (no AJAX loading), but instead the button just changes color while being tapped and nothing else happens. This only happens when the link has data-ajax="false". Setting data-rel="external" actually has no effect and JQM loads the page using AJAX (another bug). AJAX loading works fine, but that's not what I need (for a more complex project). Including the phonegap.min.js file doesn't fix the problem either.
The weird thing is that this works in the browser (not going through PhoneGap on the phone, it goes to hola.html no problem). Maybe there's something weird with how JQM and PhoneGap deal with file:// URLs?
Am I making a bonehead mistake or is there something really wrong here?
Attempt to give this a read. He points out many different issues with upgrades, this being one of them. Here is a quote detailing what probably is causing this issue: "If you are unable to open a second html page in your app then you're missing the following tag which should be placed in the application tag of your apps AndroidManifest.xml:"
<activity android:name="com.phonegap.DroidGap" android:label="#string/app_name" android:configChanges="orientation|keyboardHidden"><intent-filter></intent-filter></activity>
I hope this helps!