Phone Gap , Blackberry environment reference external JS file - blackberry

I am using Phone Gap Blackberry environment for creating apps targeted OS6.0 & above.
In the index.html, inside the head tag i am referencing the external JS file, which actually contains the data needed for my application.
EG: www. google .com/js/data.js
In the project config.xml i have also referenced the the site
EG:< access subdomains="true" uri="http :// www.google.com" />
The issue here is, i dont see the data.js file being called. This works fine with Android & Iphone environment.
Am i doing something wrong here???

In your config.xml, you need to also provide access to the google.com domain, otherwise your app won't get access to google.com and won't be able to download the script file. From your post, it looks like you only provided access to nyigf.com.
You need to add an additional element to your config.xml, i.e.
<access subdomains="true" uri="http://www.google.com" />

Related

Configure apple-app-site-association file and upload on server

I am new on iOS development. I am implementing Universal Links in iOS App with ASP.net application.
I have define my associate domain in capabilities under Associated Domains:
applinks:www.abcd.com
And also configure in App Ids on Apple Developer Account. I think app side work is all set .
But I think problem with apple-app-site-association file.
I have written json in a simple text file like below
{
"applinks": {
"apps": [],
"details": [
{
"appID": "8T8932TY.com.AppNameā€,
"paths": ["*"]
}
]
}
}
Now I am stuck here. My application targeting on iOS 9 and above. I am confused that what is the extension of this file with naming apple-app-site-association. If I need to signed in with new certificates or not. And how upload it on server side.
Please guys help me out. I am searching lot for this but not get satisfactory answer.
Thanks
Your example JSON looks fine if substituted with real values for the AppID/AppName. You may want to be specific about what routes you handle but that's up to you - it's a better user experience to only try to handle routes that there's some chance you'll be able to handle, rather than opening your app for every link on your domain and kicking the user out to Safari again if that turns out not to be true.
The apple-app-site-association file should not have any file extension, and should be served from the root of your site, https://example.com/apple-app-site-association, and/or from https://example.com/.well-known/apple-app-site-association.
You say you're supporting iOS 9 and above - the change to check the .well-known route, which is checked first, came in iOS 9.3, so if you want to support below that OS, you're best off putting the file in both locations. See this answer for details.
It's also important that the file is served with the correct MIME-type, for Universal Links it can be served as application/json, and there's no need to sign/encrypt it. Getting it served with the correct MIME-type can be a little annoying if you're not familiar with configuration on your web server, as typically servers will determine the MIME-type from the file extension. You can't give it an extension, as iOS won't check the url with an extension and (IIRC) redirects are not allowed so you can't fake it by doing that either.
So that's a summary of what you're trying to accomplish, but how you do that depends on the web server you're using. For an ASP app that's likely to be IIS, in which case this question and its answers may help you configure your web server correctly. The details of how you upload a file to the root of that server will very much depend on how you've configured it as well.
There is no extension for this apple-app-site-association file. This is just a plain file. You have to host it on the top level of your domain meaning the file location will be https://www.abcd.com/apple-app-site-association Once you host it you can check/validate by using this link https://branch.io/resources/aasa-validator/
For detailed info please refer: https://blog.branch.io/how-to-setup-universal-links-to-deep-link-on-apple-ios-9/
This worked for me.
Created an empty .NET Core project and deployed it to the corresponding Azure web app service.
Using, Advanced tools in Azure portal, nvaigated to the Kudu files of the deployed app service.
Inside the folder "site/wwwroot/wwwroot" created a new folder named ".well-known".
Inside the newly created folder, created a new file named "apple-app-site-association.json".
Edited the newly created json file to hold the app details.
Modifed the file "site/wwwroot/web.config" for the following reasons:
a) Since iOS always calls the URLs without file extension mentioned (https://webapp-sftpint-employeeapp-dev.azurewebsites.net/apple-app-site-association)
we need to forcefully reqrite such URLs to have the file extension. Hence, added the rule in web.config
b) Since the response header should have "application/json" for the content returned from the static file "apple-app-site-association.json",
we added the explicit mentioning of the mimeType as "application/json".
So, the web.config file looks somewhat like this. (only the 'rewrite' and 'staticContent' blocks needs to be added additionally)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\yourproject.dll" stdoutLogEnabled="false" stdoutLogFile=\\?\%home%\LogFiles\stdout hostingModel="inprocess" />
<rewrite>
<rules>`enter code here`
<rule name="apple_json_file">
<match url="^apple-app-site-association" />
<action type="Rewrite" url=".well-known/apple-app-site-association.json" />
</rule>
</rules>
</rewrite>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
</location>
</configuration>

InAppBrowser view doesn't match with actual browser view in ios

I am using inappbrowser to open external link in my project for ios. But the external link has horizontal scroll in "inappbrowser" , when i am opening the link in system browser ,it is opening fine. Is there any way so that i can get the external link view without scroll in inappbrowser. I am using cordova 2.8.0.
Thanks in advance .
You have many options that you can customize your view.
https://github.com/apache/cordova-plugin-inappbrowser#cordovainappbrowseropen
I dont understand if the problem is that the webview is not correctly zoomed, or you want do disable the horizontal scroll, but check this two options:
enableViewportScale and disallowoverscroll
The server that you are opening the link to may be looking for specific user agent matches to serve a mobile page template, hard to say without more detail. If that's the case, then you can override the In App Browser's user agent with a string of your choice (e.g. to match whatever the server might be expecting in order to make it render a "mobile" page).
To use this you'll need to get Cordova upgraded to something newer than 2.8 which I would recommend doing in any case, then look at the "OverrideUserAgent" setting, example from the docs:
<preference name="OverrideUserAgent" value="Mozilla/5.0 My Browser" />

How to whitelist unknown domains in blackberry 10 and webworks sdk?

I know that to access an external link, one has to whitelist the access path in config.xml.
My problem is that I am unable to use asterisk as the whitelist option. Ripple emulator does not let me do it. My app downloads a number of image links and then display those images. These images could come from any number of sources/ domains. Now how do I mention an intelligent whitelist for this purpose?
My Environment:
BlackBerry 10 WebWorks SDK 1.0.4.11
BB10 Simulator
Windows 7
The way you do that is adding this line in the config.xml file:
<access subdomains="true" uri="*" />
But there's a quirk that renders this option useless whenever you use ajax. From the docs:
You can specify a wildcard () for the uri to whitelist any domain, but only for domains that do not access application APIs and that do not access content through XMLHttpRequest. If the domain requires access to APIs or accesses data through XMLHttpRequest, you must explicitly specify the domain in the uri.*
As Mister Smith said above, the proper way to 'whitelist' a domain is by adding the wildcard access element to your config.xml
<access subdomains="true" uri="*" />
You also have the ability to disable all web-security. While this is not the first recommended approach to dealing with cross origin requests, it's sometimes needed, especially when talking to services that use a CDN. To disable all web-security you'll want to add the following to your config.xml
<feature id="blackberry.app" >
<param name="websecurity" value="disable" />
</feature>
Lastly, your Ripple issue is something separate from all of this.
Go to manage your Chrome extensions, find Rippe, and check the box that says "Allow access to file URLs", and add the following flag to your Chrome shortcut --allow-access-from-files

open html file on sdcard with phonegap and jquery mobile

i have some HTML files that users can download in runtime to sdcard. Now i want to create a link in my app to open those files. The problem is, i do not know what i should write in href property of the link tags to open the HTML files on sdcard
can anyone help me?
In the congif.xml file from my Blackberry app project locate on:
C:\Dev\phonegap\BlackBerry-WebWorks\<project_folder>\www
there are this lines:
<!-- PhoneGap API -->
<access subdomains="true" uri="file:///store/home" />
<access subdomains="true" uri="file:///SDCard" />
That config is granting access to those URI/resources, i think you can play around with that.
I have no idea how will be this URI on other plataforms, but is a good point to start the testing,
Good Luck!

Use FusionCharts in sandbox solution

Has anyone been successfully rendering charts using fusion charts in a sandboxed solution?
How would you get the SWF file onto SharePoint? I included it and deployed it via feature and the Elements.xml looks like the following:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="FusionCharts">
<File Path="FusionCharts\FCF_Column2D.swf" Url="FusionCharts/FCF_Column2D.swf" />
<File Path="FusionCharts\FCF_Gantt.swf" Url="FusionCharts/FCF_Gantt.swf" />
</Module>
</Elements>
When the sandbox solution is deployed, you can access the SWF file from http://sharepointsite/FusionCharts/FCF_Gantt.swf, the browser will attempt to open/save the file. If this file is deployed via farm solution, and be deployed to _layouts folder, which I can access via http://sharepointsite/_layouts/FusionCharts/FCF_Gantt.swf, it renders with error message "invalid xml data". The farm solution deployment is correct because MIME type is properly set to "application/x-shockwave-flash" and thus my custom web part which renders chart using this SWF file works. But if my sandboxed web part is to use the SWF file deployed as site pages, it does not work. Any idea?
Thanks in advance.
Sean
The problem is resolved with help from DevExpress team. Though SWF can be deployed to SharePoint site document library, you would need Farm Administrator to go into Central Admin pages and set the property in Application Management for the Web application to allow "Permissive". Go to Central Admin -> Application Management -> Select Web Application -> General Settings (Ribbon button), change "Browser File Handling" from "Restrict" to "Permissive".

Resources