Wondering what’s next for npm?Check out our public roadmap! »

    @titanium/permissions

    1.0.3 • Public • Published

    @titanium/permissions

    GitHub stars GitHub forks GitHub watchers @titanium/permissions Dependabot Status

    Titanium native mobile widget for permission requests

    📓   Description

    For use with requesting native device permissions on iOS and Android

    🚨   Notice

    There are 7 identical style files that are included in the ./styles directory. The reason for this is there are issues with how TSS stylesheets are loaded from widgets in Alloy and it does not currently support the concept of a widget-wide app.tss file. Any changes done to one file will need to be replicated in all the other files. Sorry about this and hopefully I can create a workaround for this in a future version of Turbo.

    https://jira.appcelerator.org/browse/TIMOB-19971


    I am pleased to say that the latest version of Titanium Turbo now has support for app.tss (albeit in an unusual way...). A feature was added to Turbo that allows you to add a style tag to your XML view which in turn, supports the src tag (not unlike the script tag).

    Take a look at the implementation to see how app.tss is used to support widget-wide styles (and more!)


      Features

    Prompts for device permissions

    • [X] Permissions for Camera
    • [X] Permissions for Location
    • [X] Permissions for Microphone
    • [X] Permissions for Notifications
    • [X] Permissions for Photos
    • [X] Permissions for Music

    Styling

    You can override the styling for any control using the ID of the control.

    IDs follow the pattern permission-{feature}-{control}

    Controls used are:

    • lottie (iOS)
    • image (Android)
    • title
    • ask
    • go
    • later

    i.e.

    "#permission-camera-title": {
    	"color": "blue"
    },

    🚀   Getting Started

    Installing

    Please ensure there is a package.json file in the target directory. If there is not one present, you can create one with npm init.

    If you wish to install this in an app using Titanium Turbo, you can execute this in the project root directory:

    npm install @titanium/permissions

    Usage

    const { camera } = require('@titanium/permissions');
    	const permissions_camera = await camera.ensure()
    			.catch(error => {
    				console.error(error);
    			});

    🎓   Learn More

    📚   Related projects

    🎟️   Modules for Titanium Mobile

      @titanium/applesignin -Native modules that allows you to use the iOS 13+ Apple Sign In API with Axway Titanium native mobile apps.

      @titanium/authentication - Titanium native mobile authentication manager

      @titanium/authentication-oauth - Titanium native mobile OAuth plugin for authentication manager

      @titanium/calendar-picker - Turbo widget that allows you to pick dates from a calendar with Axway Titanium.

      @titanium/coremotion - Native modules that allows you to use iOS CoreMotion framework with Axway Titanium native mobile apps.

      @titanium/deeply - Native modules that allows you to capture Android deep links with Axway Titanium.

      @titanium/essentials - Essential Toolkit for Titanium Turbo Native Mobile Apps

      @titanium/icloud - Native module that allows you to use the Apple iCloud framework with Axway Titanium native mobile apps.

      @titanium/identity - Native modules to add Fingerprint/FaceId/keychain access to Titanium native mobile apps

      @titanium/facebook - Native modules that allows you to use Facebook SDK with Axway Titanium native mobile apps.

      @titanium/googlesignin - Native modules that allows you to use the Google Sign-in SDK with Axway Titanium native mobile apps.

      @titanium/lottie - Native modules that allows you to use Airbnb Lottie animations with Axway Titanium native mobile apps.

      @titanium/observer - Repackaging of nx-js/observer-util for Titanium Native Mobile

      @titanium/permissions - Titanium native mobile widget for permission requests @titanium/permissions

      @titanium/please - Titanium native mobile module for politely requesting data @titanium/please

      @titanium/polyfill - Titanium native mobile polyfills necessary to use packages that depend on Node.js modules @titanium/polyfill

      @titanium/turbo - 🚀 Turbo is a version of Titanium Alloy that adds some enhancements and customizations for rapid development. @titanium/turbo

      @titanium/updater - Titanium native mobile widget to check for app updates @titanium/updater

      @titanium/webdialog - Native modules that allows you to use native SFSafariViewController (iOS) and Chrome Pages (Android) with Axway Titanium native mobile apps. @titanium/webdialog

    🎟️   Modules for Node.js and Titanium Mobile

    project description npm
    @geek/cache Caching module for Node.js and Axway Titanium @geek/cache
    @geek/jsonc JSONC and JSON utilities for JavaScript with Node.js and Axway Titanium. @geek/jsonc
    @geek/jwt JWT parser for JavaScript Node.js and Titanium native mobile @geek/jwt
    @geek/logger Logging module for Node.js and Axway Titanium @geek/logger
    @geek/mobile Toolkit for creating, building, and managing mobile app projects. @geek/mobile
    @geek/retry Retry JavaScript functions and promises in Node.js and Axway Titanium @geek/retry

    🎟️   Modules for Node.js

    project description npm
    @geek/google-sheets Easy way to manage Google Sheets API from Node.js @geek/google-sheets

    📣   Feedback

    Have an idea or a comment? Join in the conversation here!


    Follow Brenton House

    Follow Brenton House for the latest on great modules and libraries!

    Twitter Follow LinkedIn Follow Github Followers


    ©️   Legal

    The MIT License (MIT)

    Copyright (c) 2019-Present -- Brenton House
    https://brenton.house

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    Install

    npm i @titanium/permissions

    DownloadsWeekly Downloads

    6

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    396 kB

    Total Files

    30

    Last publish

    Collaborators

    • avatar