Skip to content

Commit

Permalink
V7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
myflashlab committed Apr 5, 2017
1 parent 6033d28 commit bfa725a
Show file tree
Hide file tree
Showing 14 changed files with 258 additions and 54 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Rich WebView Adobe Air Native Extension

*Apr 05, 2017 - V7.0.0*
* Added support for Android customtabs - Sample codes updated
* Added support for iOS safariViewController - Sample codes updated
* Updated the ANE with the latest version of overrideAir. if you are building for iOS only, you still need to include this dependency in your project

*Nov 08, 2016 - V6.6.0*
* Optimized for Android manual permissions if you are targeting AIR SDK 24+
* From now on, this ANE will depend on androidSupport.ane and overrideAir.ane on the Android side
Expand Down
60 changes: 33 additions & 27 deletions FD/application.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<application xmlns="http://ns.adobe.com/air/application/24.0">
<id>com.doitflash.exWebView</id>
<versionNumber>6.6.0</versionNumber>
<versionNumber>7.0.0</versionNumber>
<supportedProfiles>mobileDevice</supportedProfiles>
<filename>exWebView</filename>
<name>Rich Webview</name>
Expand Down Expand Up @@ -34,6 +34,8 @@
<!-- required for html file select buttons -->
<activity android:name="com.doitflash.webView.Pick" android:theme="@style/Theme.Transparent" />
<receiver android:name="com.doitflash.webView.ChromeTabActionBroadcastReceiver" />
</application>
</manifest>]]></manifestAdditions>
Expand All @@ -43,24 +45,26 @@
<!--http://help.adobe.com/en_US/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html-->
<!-- A list of plist key/value pairs to be added to the application Info.plist -->
<InfoAdditions>
<![CDATA[<key>MinimumOSVersion</key>
<string>6.1</string>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleBlackOpaque</string>
<key>UIRequiresPersistentWiFi</key>
<string>NO</string>
<![CDATA[
<key>UIPrerenderedIcon</key>
<true />
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key><true/>
</dict>
<!--required for webview GPS access-->
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleBlackOpaque</string>
<key>UIRequiresPersistentWiFi</key>
<string>NO</string>
<key>UIPrerenderedIcon</key>
<true />
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key><true/>
</dict>
<!--required for webview GPS access-->
<key>NSLocationUsageDescription</key>
<string>I need location 1</string>
Expand All @@ -70,13 +74,13 @@
<key>NSLocationAlwaysUsageDescription</key>
<string>I need location 3</string>
<key>UIDeviceFamily</key>
<array>
<!-- iPhone support -->
<string>1</string>
<!-- iPad support -->
<string>2</string>
</array>]]></InfoAdditions>
<key>UIDeviceFamily</key>
<array>
<string>1</string>
<string>2</string>
</array>
]]></InfoAdditions>

<requestedDisplayResolution>high</requestedDisplayResolution>
</iPhone>
Expand All @@ -85,8 +89,8 @@
<content>ex.swf</content>
<visible>true</visible>
<fullScreen>true</fullScreen>
<autoOrients>false</autoOrients>
<aspectRatio>portrait</aspectRatio>
<autoOrients>true</autoOrients>
<!--<aspectRatio>portrait</aspectRatio>-->
<renderMode>direct</renderMode>
<!--<depthAndStencil>true</depthAndStencil>-->
<!-- required for 3D -->
Expand All @@ -105,13 +109,15 @@
<!--<image512x512>icons/icon_512.png</image512x512>-->
</icon>
<extensions>

<extensionID>com.myflashlab.air.extensions.webView</extensionID>

<!-- Required if you are targetting AIR 24+ and have to take care of Permissions mannually -->
<extensionID>com.myflashlab.air.extensions.permissionCheck</extensionID>

<!-- The following dependency ANEs are only required when compiling for Android -->
<!-- download the dependency ANEs from https://github.com/myflashlab/common-dependencies-ANE -->
<extensionID>com.myflashlab.air.extensions.dependency.androidSupport</extensionID>
<extensionID>com.myflashlab.air.extensions.dependency.overrideAir</extensionID>

</extensions>
</application>
4 changes: 2 additions & 2 deletions FD/bat/RunApp.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ call bat\SetupApp.bat
:target
::goto desktop
::goto android-debug
::goto android-test
goto android-captive
goto android-test
::goto android-captive
set INTERPRETER=-interpreter
::goto ios-debug
::goto ios-test
Expand Down
2 changes: 1 addition & 1 deletion FD/bat/SetupApp.bat
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ set DIST_PATH=dist
set DIST_NAME=theApp

:: Debugging using a custom IP
set DEBUG_IP=192.168.0.24
for /f "delims=[] tokens=2" %%b in ('ping -4 -n 1 %ComputerName% ^| findstr [') do set DEBUG_IP=%%b

:validation
findstr /C:"<id>%APP_ID%</id>" "%APP_XML%" > NUL
Expand Down
12 changes: 4 additions & 8 deletions FD/bat/SetupSDK.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ cd %~dp0 & cd ..

:user_configuration

:: Static path to Flex SDK
set FLEX_SDK=D:\flex_sdk_4.6_air_sdk_24-beta

:: Use FD supplied SDK path if executed from FD
if exist "%FD_CUR_SDK%" set FLEX_SDK=%FD_CUR_SDK%
call .\..\..\..\SDK.bat
:: remove the above line and set the SDK paths directly like below
::set FLEX_SDK=D:\flex_sdk_4.6_air_sdk_24-beta
::set ANDROID_SDK=D:\android

set AUTO_INSTALL_IOS=yes

:: Path to Android SDK
set ANDROID_SDK=D:\android

:validation
if not exist "%FLEX_SDK%\bin" goto flexsdk
if not exist "%ANDROID_SDK%\platform-tools" goto androidsdk
Expand Down
2 changes: 1 addition & 1 deletion FD/bin/demoHtml/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
<body>
<div class="container">
<div class="jumbotron">
<h2>Rich WebView ANE V6.6.0 (iOS+Android)</h2>
<h2>Rich WebView ANE V7.0.0 (iOS+Android)</h2>
<button class="btn btn-primary btn-lg" type="button" onClick="AirBridge.evoke('closeWebView()')">closeWebView</button>
<hr>
<p>
Expand Down
Binary file modified FD/bin/ex.swf
Binary file not shown.
6 changes: 6 additions & 0 deletions FD/dist/ReadMe.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This demo apk is built with shared runtime but nothing can stop you from building your own final product in captive mode!
We used shared packaging just because the final size of the .apk is much smaller and it will be easier for people to download
the github project.

Shared compiled .apk files will run only if the official Adobe Air app is installed on your device.
https://play.google.com/store/apps/details?id=com.adobe.air
Binary file modified FD/dist/theApp.apk
Binary file not shown.
Binary file modified FD/lib/richWebView.ane
Binary file not shown.
12 changes: 6 additions & 6 deletions FD/obj/exWebViewConfig.old
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
<value>'11/8/2016'</value>
<value>'4/5/2017'</value>
</define>
<define append="true">
<name>CONFIG::air</name>
Expand All @@ -34,17 +34,17 @@
<omit-trace-statements>true</omit-trace-statements>
<verbose-stacktraces>false</verbose-stacktraces>
<source-path append="true">
<path-element>D:\project\ANEs\webView\Vx.x.x\FD\src</path-element>
<path-element>D:\ANEs\webView\Vx.x.x\FD\src</path-element>
<path-element>C:\Program Files (x86)\FlashDevelop\Library\AS3\classes</path-element>
</source-path>
<library-path append="true">
<path-element>D:\project\ANEs\webView\Vx.x.x\FD\lib\greensock.swc</path-element>
<path-element>D:\project\ANEs\webView\Vx.x.x\FD\lib\richWebView.ane</path-element>
<path-element>D:\project\ANEs\webView\Vx.x.x\FD\lib\permissionCheck.ane</path-element>
<path-element>D:\ANEs\webView\Vx.x.x\FD\lib\greensock.swc</path-element>
<path-element>D:\ANEs\webView\Vx.x.x\FD\lib\richWebView.ane</path-element>
<path-element>D:\ANEs\webView\Vx.x.x\FD\lib\permissionCheck.ane</path-element>
</library-path>
</compiler>
<file-specs>
<path-element>D:\project\ANEs\webView\Vx.x.x\FD\src\Demo.as</path-element>
<path-element>D:\ANEs\webView\Vx.x.x\FD\src\Demo.as</path-element>
</file-specs>
<default-background-color>#C0C0C0</default-background-color>
<default-frame-rate>30</default-frame-rate>
Expand Down
12 changes: 6 additions & 6 deletions FD/obj/exWebViewConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
<value>'11/8/2016'</value>
<value>'4/5/2017'</value>
</define>
<define append="true">
<name>CONFIG::air</name>
Expand All @@ -34,17 +34,17 @@
<omit-trace-statements>true</omit-trace-statements>
<verbose-stacktraces>false</verbose-stacktraces>
<source-path append="true">
<path-element>D:\project\ANEs\webView\Vx.x.x\FD\src</path-element>
<path-element>D:\ANEs\webView\Vx.x.x\FD\src</path-element>
<path-element>C:\Program Files (x86)\FlashDevelop\Library\AS3\classes</path-element>
</source-path>
<library-path append="true">
<path-element>D:\project\ANEs\webView\Vx.x.x\FD\lib\greensock.swc</path-element>
<path-element>D:\project\ANEs\webView\Vx.x.x\FD\lib\richWebView.ane</path-element>
<path-element>D:\project\ANEs\webView\Vx.x.x\FD\lib\permissionCheck.ane</path-element>
<path-element>D:\ANEs\webView\Vx.x.x\FD\lib\greensock.swc</path-element>
<path-element>D:\ANEs\webView\Vx.x.x\FD\lib\richWebView.ane</path-element>
<path-element>D:\ANEs\webView\Vx.x.x\FD\lib\permissionCheck.ane</path-element>
</library-path>
</compiler>
<file-specs>
<path-element>D:\project\ANEs\webView\Vx.x.x\FD\src\Demo.as</path-element>
<path-element>D:\ANEs\webView\Vx.x.x\FD\src\Demo.as</path-element>
</file-specs>
<default-background-color>#C0C0C0</default-background-color>
<default-frame-rate>30</default-frame-rate>
Expand Down
102 changes: 100 additions & 2 deletions FD/src/Demo.as
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,105 @@ package
//RichWebViewSettings.USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.36 (KHTML, like Gecko) Chrome/13.0.766.0 Safari/534.36"; // useful when you are trying to load embedded YouTube or Vimeo videos
RichWebViewSettings.ENABLE_AIR_PREFIX = true; // This property works on Android ONLY and is set to true by default.

// initialize the embedded Browser feature
if (!_ex.isEmbeddedBrowserInitialized)
{
_ex.addEventListener(RichWebViewEvent.EMBEDDED_BROWSER_NAVIGATION_EVENT, onEmbeddedBrowserNavigationEvent);
_ex.addEventListener(RichWebViewEvent.EMBEDDED_BROWSER_ACTION, onEmbeddedBrowserAction);
_ex.initEmbeddedBrowser();
}

// set optional settings for the embedded browser - Android side
RichWebViewSettings.EMBEDDED_BROWSER.android.toolbarColor = "#3F51B5";
RichWebViewSettings.EMBEDDED_BROWSER.android.secondaryToolbarColor = "#303F9F";
RichWebViewSettings.EMBEDDED_BROWSER.android.addMenuItem("item 1", true);
RichWebViewSettings.EMBEDDED_BROWSER.android.addMenuItem("item 2");
RichWebViewSettings.EMBEDDED_BROWSER.android.addMenuItem("item 3");
RichWebViewSettings.EMBEDDED_BROWSER.android.addMenuItem("item 4");
RichWebViewSettings.EMBEDDED_BROWSER.android.actionButton("ic_default_action_btn_for_custom_tab", "action btn description"); // use the Resource Manager Tool to add the icon into "richWebView.ane"
RichWebViewSettings.EMBEDDED_BROWSER.android.enableUrlBarHiding = true;
RichWebViewSettings.EMBEDDED_BROWSER.android.closeBtnIcon = "ic_default_close_btn_for_custom_tab"; // use the Resource Manager Tool to add the icon into "richWebView.ane"
RichWebViewSettings.EMBEDDED_BROWSER.android.showTitle = true;
RichWebViewSettings.EMBEDDED_BROWSER.android.defaultShareMenuItem = true;
RichWebViewSettings.EMBEDDED_BROWSER.android.isWeakActivity = false;
RichWebViewSettings.EMBEDDED_BROWSER.android.mayLaunchUrl = "https://www.google.com/";

// set optional settings for the embedded browser - iOS side
RichWebViewSettings.EMBEDDED_BROWSER.ios.barColor = "#CCCCCC"; // if iOS < 10, nothing happens
RichWebViewSettings.EMBEDDED_BROWSER.ios.controlColor = "#AAAAAA"; // if iOS < 10, nothing happens

// ---------------------------------------------------------------------------------------------------------------------

if (_ex.isEmbeddedBrowserSupported())
{
var btn0:MySprite = createBtn("open Embedded Browser");
btn0.addEventListener(MouseEvent.CLICK, openEmbeddedBrowser);
_list.add(btn0);
}

// ---------------------------------------------------------------------------------------------------------------------

function openEmbeddedBrowser(e:MouseEvent):void
{
var result:Boolean = _ex.openEmbeddedBrowser("https://www.google.com/");

if (!result)
{
C.log("could not open! Possible reasons are:");
C.log("1) Have you called \"_ex.initEmbeddedBrowser();\"? ");
C.log("2) Make sure all the \"RichWebViewSettings.EMBEDDED_BROWSER\" parameters are valid.");
}
}

function onEmbeddedBrowserNavigationEvent(e:RichWebViewEvent):void
{
switch (e.param)
{
case RichWebViewEvent.EMBEDDED_BROWSER_NAVIGATION_STARTED:

trace("EMBEDDED_BROWSER NAVIGATION_STARTED");

break;
case RichWebViewEvent.EMBEDDED_BROWSER_NAVIGATION_FINISHED:

trace("EMBEDDED_BROWSER NAVIGATION_FINISHED");

break;
case RichWebViewEvent.EMBEDDED_BROWSER_NAVIGATION_FAILED:

trace("EMBEDDED_BROWSER NAVIGATION_FAILED");

break;
case RichWebViewEvent.EMBEDDED_BROWSER_NAVIGATION_ABORTED:

trace("EMBEDDED_BROWSER NAVIGATION_ABORTED");

break;
case RichWebViewEvent.EMBEDDED_BROWSER_CLOSED:

trace("EMBEDDED_BROWSER CLOSED");
C.log("EMBEDDED_BROWSER CLOSED");

break;
default:
}
}

function onEmbeddedBrowserAction(e:RichWebViewEvent):void
{
trace("--------- onEmbeddedBrowserAction ------------");
trace("item = " + e.param.item);
trace("url = " + e.param.url);
trace("----------------------------------------------");

C.log("--------- onEmbeddedBrowserAction ------------");
C.log("item = " + e.param.item);
C.log("url = " + e.param.url);
C.log("----------------------------------------------");
}

// ---------------------------------------------------------------------------------------------------------------------

var btn1:MySprite = createBtn("openWebView");
btn1.addEventListener(MouseEvent.CLICK, openWebViewLocal);
_list.add(btn1);
Expand All @@ -227,7 +326,7 @@ package
{
//_ex.openWebViewLocal(0, 0, stage.stageWidth, stage.stageHeight, File.documentsDirectory.resolvePath("demoHtml/index.html"));
_ex.openWebViewLocal(0, 0, stage.stageWidth, stage.stageHeight, File.applicationStorageDirectory.resolvePath("demoHtml/index.html"));
//_ex.openWebViewURL(0, 0, stage.stageWidth, stage.stageHeight, "http://google.com/");
//_ex.openWebViewURL(0, 0, stage.stageWidth, stage.stageHeight, "https://google.com/");

// opening a pdf in iOS is very straight forward like this:
//_ex.openWebViewURL(0, 0, stage.stageWidth, stage.stageHeight, "http://www.myflashlabs.com/showcase/test.pdf");
Expand Down Expand Up @@ -327,7 +426,6 @@ package
private function onTouch(e:RichWebViewEvent):void
{
trace("onTouch > " + "x = " + e.param.x + " y = " + e.param.y);
C.log("onTouch > " + "x = " + e.param.x + " y = " + e.param.y);
}

// --------------------------------------------------------------------------------- funcs to be called from JS
Expand Down
Loading

0 comments on commit bfa725a

Please sign in to comment.