Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

Commit c95028e

Browse files
author
Mattia Panzeri
authored
Merge pull request #24 from panz3r/master
Fix CustomJSON event handling on Android
2 parents f2e2366 + ab0d507 commit c95028e

File tree

108 files changed

+19
-7396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+19
-7396
lines changed

README.md

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# React Native NearIT SDK
2+
23
> The official [NearIT](https://www.nearit.com) SDK plugin for [React Native](https://facebook.github.io/react-native/)
34
45
[![license](https://img.shields.io/github/license/panz3r/react-native-nearit-sdk.svg)](https://github.com/panz3r/react-native-nearit-sdk/blob/master/LICENSE.md)
@@ -16,6 +17,7 @@
1617
NearIT allows to engage app users by sending **context-aware targeted content**.
1718

1819
## Recipes
20+
1921
NearIT allows to manage apps by defining "recipes". Those are simple rules made of 3 ingredients:
2022

2123
* **WHO**: define the target users
@@ -25,6 +27,7 @@ NearIT allows to manage apps by defining "recipes". Those are simple rules made
2527
<br>
2628

2729
## How it works
30+
2831
[**NearIT web interface**](https://go.nearit.com/) allows you to configure all the features quickly.
2932
Once the settings are configured, **everyone** - even people without technical skills - can manage context-aware mobile content.
3033

@@ -33,11 +36,12 @@ Once the settings are configured, **everyone** - even people without technical s
3336
<br>
3437

3538
## Installation
39+
3640
Minimum Requirements:
3741

38-
- **React Native**: 0.45.0+
39-
- **Android** Min SDK: ***16***
40-
- **iOS** Min Platform: ***iOS 9***
42+
* **React Native**: 0.45.0+
43+
* **Android** Min SDK: **_16_**
44+
* **iOS** Min Platform: **_iOS 9_**
4145

4246
To start using the SDK, add this plugin to your React Native project
4347

@@ -54,7 +58,17 @@ $ react-native link react-native-nearit
5458
<br/>
5559

5660
## Integration guide
61+
5762
For information on how to integrate all NearIT features in your app, visit the [documentation website](https://nearit-react-native-sdk.readthedocs.io/)
5863

64+
<br/>
65+
66+
## Sample Integration
67+
68+
A sample ReactNative app integrating `react-native-nearit` SDK is available at [panz3r/nearit-react-native-sample-app](https://github.com/panz3r/nearit-react-native-sample-app)
69+
70+
<br/>
71+
5972
---
73+
6074
Made with :sparkles: & :heart: by [Mattia Panzeri](https://github.com/panz3r) and [contributors](https://github.com/nearit/React-Native-SDK/graphs/contributors)

android/src/main/java/it/near/sdk/reactnative/rnnearitsdk/RNNearItCoreContentsListener.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import com.facebook.react.bridge.WritableMap;
1717
import com.facebook.react.bridge.WritableNativeMap;
1818
import com.facebook.react.modules.core.DeviceEventManagerModule;
19-
import com.google.gson.Gson;
2019

2120
import it.near.sdk.reactions.contentplugin.model.Content;
2221
import it.near.sdk.reactions.couponplugin.model.Coupon;
@@ -96,7 +95,7 @@ public void gotCustomJSONNotification(CustomJSON customJSON, TrackingInfo tracki
9695
// Create EventContent map
9796
final WritableMap contentMap = new WritableNativeMap();
9897
contentMap.putString(EVENT_CONTENT_MESSAGE, customJSON.notificationMessage);
99-
contentMap.putString(EVENT_CONTENT_DATA, new Gson().toJson(customJSON.content));
98+
contentMap.putMap(EVENT_CONTENT_DATA, RNNearItUtils.toWritableMap(customJSON.content));
10099

101100
// Notify JS
102101
sendEventWithContent(EVENT_TYPE_CUSTOM_JSON, contentMap, trackingInfo);

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-nearit",
3-
"version": "2.5.6-beta.1",
3+
"version": "2.5.6-beta.2",
44
"author": "Mattia Panzeri <[email protected]>",
55
"license": "MPL-2.0",
66
"description": "The official NearIT SDK plugin for React Native",

sample/.babelrc

-3
This file was deleted.

sample/.buckconfig

-6
This file was deleted.

sample/.flowconfig

-45
This file was deleted.

sample/.gitattributes

-1
This file was deleted.

sample/.gitignore

-70
This file was deleted.

sample/.watchmanconfig

-1
This file was deleted.

0 commit comments

Comments
 (0)