3.1.1 • Published 4 months ago

mopinion-react-native-sdk v3.1.1

Weekly downloads
145
License
MIT
Repository
github
Last release
4 months ago

Mopinion for React Native

Easily collect in-app feedback with the Mopinion SDK for React Native.

Installation

To install the Mopinion SDK into your React Native Application:

  1. In a terminal window, navigate to the root directory of your project and run:
npm install mopinion-react-native-sdk --save
  1. Link icon font
npx react-native-asset -asset node_modules/mopinion-react-native-sdk/assets/fonts
  1. Install peerDependencies, these have to be installed separately because they require linking of native modules.
npm install @react-native-async-storage/async-storage react-native-webview react-native-view-shot react-native-image-picker  --save
  1. Install native modules:
cd ios && bundle exec pod install

When using the image upload functionality.

The SDK allows users to pick an image from her/his device to upload as a screenshot. To enable this on iOS, make sure to add the Privacy - Photo Library Usage Description permission to the Info.plist of your app in Xcode:

<key>NSPhotoLibraryUsageDescription</key>
<string>To use an image from your library as a screenshot</string>

Implementing the SDK

Import the MopinionDeployment component in your main app file:

import { MopinionDeployment } from 'mopinion-react-native-sdk'

Add a <MopinionDeployment /> component with your deployment ID to the top level of your app structure:

function YourApp() {
	//...
	return (
		<TopLevel>
			{
				//app content
			}
			<MopinionDeployment deploymentID="YOUR_DEPLOYMENT_ID" />
		</TopLevel>
	);
}

Trigger events from anywhere you might want to show a form.

Pro tip, preemptively implement event calls in relevant places throughout your application so other teams working with Mopinion can easily add or remove forms via the Mopinion platform without changes to your app code. Forms are only shown if the event matches parameters defined in your deployment.

import { MopinionSDK } from 'mopinion-react-native-sdk';

//...

<PurchaseButton
	onPress={() => {
		handlePurchase();
		MopinionSDK.event('purchase_completed);
	}}
/>

Passing meta data from your app into Mopinion forms

You can send an object of data along with the feedback sent by your users using the metaData prop. This is useful for passing along various metadata that you might want to have linked to a users feedback.

<MopinionDeployment
	//required
	deploymentID={'YOUR_ID_HERE'}
	//optional
	metaData={{
		meta:'value',
		meta2:'value2',
		meta3:'value3'
	}}
/>

Properties

PropertyDescriptionType
deploymentIDRequired the identifier of your deploymentstring
metaDataAn object with string values which will be passed along as feedback when your users submit a formRecord<string, string \| number>
fireWhenReadyArray of events to fire when the deployment is readyArray<string>
modalAnimationDurationCustomize the animation duration of the feedback dialog (default: 400, set to 0 to disable animations)number
onOpenCallback fired when a form opensfunction
onFormLoadedCallback fired when a form configuration is loadedfunction
onCloseCallback fired when a form closes after being openfunction
onFeedbackSentCallback fired when a feedback form has been fully submittedfunction

Support

Mopinion For React Native is maintained by the Mopinion Development Team. For support contact support@mopinion.com

3.1.1

4 months ago

3.1.0

7 months ago

3.0.2

9 months ago

3.0.1

1 year ago

3.0.0

1 year ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.1-rc1

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.1

4 years ago

2.0.0

4 years ago

2.0.0-beta5

4 years ago

2.0.0-beta3

4 years ago

2.0.0-beta4

4 years ago

2.0.0-beta1

4 years ago

2.0.0-beta2

4 years ago

1.4.1

4 years ago

1.4.0

5 years ago

1.2.4-rc1

5 years ago

1.3.0

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.1-rc1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

1.0.0-rc5

5 years ago

1.0.0-rc6

5 years ago

1.0.0-rc7

5 years ago

1.0.0-rc4

5 years ago

1.0.0-rc1

5 years ago

1.0.0-rc2

5 years ago

1.0.0-rc3

5 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.7

6 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago