1.0.4 • Published 1 year ago

mkdm-rn-permissions v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

EASY INTEGRATION PERMISSIONS PROVIDER FOR REACT NATIVE

Push notifications and devices capabilities permissions ready to use for every react native project.

import * as React from "react";
import RNPermissionProvider from "mkdm-rn-permissions";

export default function App() {
  const sendPushTokenToServer = async (token) => {
    try {
      //Send pusk token to store it in db.
    } catch {}
  };

  const onPermissionError = (error) => console.log(error);
  return (
    <RNPermissionProvider
      camera={true}
      microphone={false}
      notifications={true}
      handlePushToken={sendPushTokenToServer}
      handleError={onPermissionError}
    >
      {/*
        The rest of your app goes here
      */}
    </RNPermissionProvider>
  );
}

Initialization

First run...

    yarn add expo-notifications expo-camera

Or

    npm i expo-notifications expo-camera

And...

    yarn add mkdm-rn-permissions

Properties and Methods

PROPERTIESTYPEDefaultDescription
camerabooleanfalseIf true, camera permission will be display at first app launch.
microphonebooleanfalseIf true, microphone permission will be display at first app launch.
notificationsbooleanfalseIf true,push notifications permission will be display at first app launch.

METHODSDescription
handlePushTokenGet push token as param
handleErrorGet error message as param
handleNotificationGet Notification object as param
handleNotificationResponseGet NotificationResponse object as param
1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago