npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@unimodules/react-native-platform

v0.1.17

Published

This library contains the core Unimodule infrastructure and a collection of Unimodules and interfaces that are commonly depended on by other Unimodules. You will need to install this before using libraries from Foundation, like `expo-camera`, `expo-media-

Downloads

26

Readme

@unimodules/react-native-platform

This library contains the core Unimodule infrastructure and a collection of Unimodules and interfaces that are commonly depended on by other Unimodules. You will need to install this before using libraries from Foundation, like expo-camera, expo-media-library, and others.

Installation

The easiest way to do this is to initialize a "custom" project with expo-cli. If you have an existing app, you can follow these steps instead. This project requires that you use Cocoapods on iOS, to set iot up see this gist, or relevant parts of the this guide.

Install the package

npm install @unimodules/react-native-platform

Configure iOS

  • Go back to the ios directory and open your Podfile, make your Podfile look like this one.
    • If you need to customize the path to node_modules, for example because you are using yarn workspaces, then you can pass in a param for this: use_unimodules!(node_modules_path: '../../../node_modules')
  • Run pod install again
  • Update your AppDelegate.h and AppDelegate.m according to this diff.

Add permission usage description keys to Info.plist

In order to submit your app to the App Store, you will need to eventually add these keys to your Info.plist. Even if you don't use the APIs described, you need to include the keys because code related to asking the permission will be bundled regardless, and Apple's static analysis tools will detect it and reject your app if the key isn't present. Including the key without using it has no impact to your users. Replace (YOUR APP NAME) with your app name below.

<key>NSCalendarsUsageDescription</key>
<string>Allow (YOUR APP NAME) to access your calendar</string>
<key>NSCameraUsageDescription</key>
<string>Allow (YOUR APP NAME) to use the camera</string>
<key>NSContactsUsageDescription</key>
<string>Allow (YOUR APP NAME) experiences to access your contacts</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Allow (YOUR APP NAME) to use your location</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Allow (YOUR APP NAME) to use your location</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Allow (YOUR APP NAME) to use your location</string>
<key>NSMicrophoneUsageDescription</key>
<string>Allow (YOUR APP NAME) to access your microphone</string>
<key>NSMotionUsageDescription</key>
<string>Allow (YOUR APP NAME) to access your device's accelerometer</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Give (YOUR APP NAME) periences permission to save photos</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Give (YOUR APP NAME) periences permission to access your photos</string>
<key>NSRemindersUsageDescription</key>
<string>Allow (YOUR APP NAME) to access your reminders</string>

Configure Android

  • Add apply from: '../node_modules/@unimodules/react-native-platform/settings.gradle' and then useUnimodules.apply() to the top of android/settings.gradle
    • If you need to customize the path to node_modules, for example because you are using yarn workspaces, then you can pass in a param for this: useUnimodules.apply(nodeModulesPath: "../../../node_modules")
  • Add apply from: '../../node_modules/@unimodules/react-native-platform/build.gradle' anywhere in android/app/build.gradle
  • Update minSdkVersion in android/build.gradle to 21
  • Update your MainApplication.java to according to this diff.

API

It's possible that you will not have to use any of the code provided by this package directly, it may be used only by other Unimodules that you install.

But it's likely that you will want to use something like FileSystem or Permissions, and to do that you can import the following modules like so:

import {
  Asset,
  Constants,
  FileSystem,
  Permissions,
} from '@unimodules/react-native-platform';

You can import them directly from the specific Unimodule packag if you like, but your linter may complain for import a transitive dependency.

import * as Permissions from 'expo-permissions';