Giter Site home page Giter Site logo

tidev / titanium-web-dialog Goto Github PK

View Code? Open in Web Editor NEW
30.0 14.0 18.0 4.67 MB

Use the SFSafariViewController (iOS) and Chrome Pages (Android) in Titanium.

License: Other

Java 40.86% JavaScript 22.22% Objective-C 36.39% Shell 0.53%
sfsafariviewcontroller chrome-tabs ios android cross-platform titanium native javascript titanium-module

titanium-web-dialog's Introduction

Titanium Web Dialog

Use the native SFSafariViewController (iOS) and Chrome Pages (Android) within Appcelerator Titanium.

Titanium Web Dialog

Requirements

  • Titanium SDK 9.0.0 or later
  • iOS 9+ and Android 4.1+

iOS Note

The iOS part of this module is based on Ti.SafariDialog, which has been deprecated for a cross-platform solution. All API's of Ti.SafariDialog still work here and have been extended by more features over time.

Android Note

In order to use the close event on Android it is recommended to have a short delay between var WebDialog = require('ti.webdialog'); and WebDialog.open({}). Otherwise it might not fire the close event.

API's

Top-Level

Methods

  • open(arguments)

    • url (String)
    • barColor (String)
    • animated (Boolean, iOS only)
    • entersReaderIfAvailable (Boolean, iOS only)
    • barCollapsingEnabled (Boolean)
    • title (String, iOS only)
    • tintColor (String, iOS only)    * dismissButtonStyle (DISMISS_BUTTON_STYLE_*, iOS only)
    • showTitle (Boolean, Android only)
    • fadeTransition (Boolean, Android only)
    • enableSharing (Boolean, Android only) - Enable Share... menu item to share link
    • closeIcon (String, Android only) - image path to show as close-button icon
  • isSupported() -> Boolean

  • isOpen() (iOS only) -> Boolean

  • close() (iOS only)

Properties

  • DISMISS_BUTTON_STYLE_DONE (iOS only)
  • DISMISS_BUTTON_STYLE_CLOSE (iOS only)
  • DISMISS_BUTTON_STYLE_CANCEL (iOS only)

Events

  • open -> success (Boolean), url (String)
  • close -> success (Boolean), url (String)
  • load -> success (Boolean), url (String) - iOS only
  • redirect -> url (String) - iOS only

AuthenticationSession (iOS only)

Methods

  • createAuthenticationSession(arguments)
    • url (String)
    • scheme (String)

Events

  • callback -> success (Boolean), callbackURL (String)

License

Apache 2.0

Author

titanium-web-dialog's People

Contributors

akansha-maheshwari avatar caspahouzer avatar cb1kenobi avatar dependabot-preview[bot] avatar dependabot[bot] avatar ewanharris avatar garymathews avatar hansemannn avatar janvennemann avatar jquick-axway avatar m1ga avatar prashantsaini1 avatar sgtcoolguy avatar ssjsamir avatar vijaysingh-axway avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

titanium-web-dialog's Issues

Title not working

Excellent module. For some reason I can't get the title to override the url showing in the title bar. Is this default? Otherwise the "title" property has no relevance.

App crashes when closing web dialog on x86 Android emulator

I copied the example code and pasted it into a fresh Alloy project.

Opening the dialog works fine, but when you try to close it, the app crashes and restarts.

Note: This only seems to affect Android x86 emulators

Edit: Closing this issue. When I arrived in the office the next morning, it worked fine on x86. I'm not sure what fixed it other than a simple restart of my PC I guess.
Thanks for this module, it's great!

iOS : Format 'url' property to auto prefix 'http' as in Android

Hans, could you please make the 'url' property to auto check for 'http' prefix before any url as it's in Android?

Though it's not necessary that all websites will use 'http', but it will save some users at least as it's a very simple issue but quite hard to track. OR we can show a log message to prefix the url with http or https as required.

Title label and VoiceOver

I have a blind person using my app who using iOS's VoiceOver to navigate around it. He tells me that when I use ti.webdialog the title label (showing the website address) covers the 'Done' button and 'Reload' control. Interestingly the latter can be selected with a deft tap on it, but the 'Done' button is tricker to select. I think I'm right that on other views where there is a title the label only extends to the bounds of the text it contains. On ti.webdialog (as viewed by a sited person) the label extends right across the screen.
One other thing - I can't seem to get the 'title' property to work when doing webDialog.open - once opened the web dialog always shows the website address.

Access data from the web dialog.

I am switching from titanium webview to titanium-web-dialog, but how do I transfer data from webview to app side.
Previously, I was using Ti.App.fireEvent("fromWebView", {}) on website and Ti.App.addEventListener("fromWebView", function(){}); on the app , Does not that work anymore for this ?

Android: more color options

While updating to the new library I saw that it is possible to set different colors too:

  • setNavigationBarColor
  • setNavigationBarDividerColor
  • setToolbarColor
  • setSecondaryToolbarColor

currently the module only uses the bar color (setToolbarColor).

How to add it:

Doesn't work on Android when targetSDKVersion >= 30

When my app use targetSDKVersion = 30, ti.webdialog.open(url) doesn't do anything.

From adb log I noticed it is blocked from opening the browser. Tested on Samsung s21 Ultra with both Chrome and default Samsung Internet are installed.

`11-12 15:01:41.752 1317 4306 I AppsFilter: interaction: PackageSetting{7ed236d com.myapp/10532} -> PackageSetting{7a02cd6 com.android.chrome/10256} BLOCKED

11-12 15:01:41.752 17911 17911 I TiChromeDialog: (main) [173,7119] No browsers available in this device.

11-12 15:01:42.036 1777 1923 D ScanFilter: manu data matches`

Android: Cannot use app links to redirect back to the app

I am trying to implement an auth flow where the users logins via Custom Tab and then redirected back to the app with an app-link (https), but the redirect is still handled by the tab. If I select 'Open In Chrome' button from the menu, then app links works correctly. Is there anyway to avoid/fix that?

Thank you in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.