-
Notifications
You must be signed in to change notification settings - Fork 11
Contains the React Native Griffon plugin, sample app and Unit tests. #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial comments, can you remove Pods
so its easier to review? Currently, my browser is struggling to load the diff due to the size.
RCTACPReactNativeAcpGriffon.podspec
Outdated
@@ -0,0 +1,25 @@ | |||
|
|||
Pod::Spec.new do |s| | |||
s.name = "RCTACPReactNativeAcpGriffon" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you updated the podspec to be consistent with the other React Native podspecs we have (naming, summary, etc)
https://github.com/adobe/react-native-acpanalytics/blob/master/RCTACPAnalytics.podspec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the Podspec.
README.md
Outdated
|
||
#### iOS | ||
|
||
1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't advertise manual installation, I'd recommend only providing instructions using react-native link
and the auto-link feature introduced in RN 0.60+.
https://github.com/adobe/react-native-acpanalytics#2-install-javascript-packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update it once I update Readme.md
@@ -0,0 +1,39 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this file to use the same versions as used in other RN packages unless there is a specific need from Girffon to use different versions. https://raw.githubusercontent.com/adobe/react-native-acpanalytics/master/android/build.gradle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
README.md
Outdated
# react-native-acpgriffon | ||
Adobe Experience Platform - Project Griffon plugin for React-Native apps | ||
|
||
# adobe-mobile-marketing-react-native-acp-griffon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update to use the format other RN packages are using for their readme: https://github.com/adobe/react-native-acpanalytics/blob/master/README.md
@@ -0,0 +1,43 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the copyright header.
/*
Copyright 2020 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the copyright header.
|
||
@ReactMethod | ||
public void startSession(final String url) { | ||
Griffon.startSession(url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle the case where url
could be null
@@ -0,0 +1,28 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing copyright header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.uimanager.ViewManager; | ||
import com.facebook.react.bridge.JavaScriptModule; | ||
public class RCTACPReactNativeAcpGriffonPackage implements ReactPackage { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about naming conventions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed as per convention.
index.js
Outdated
@@ -0,0 +1,4 @@ | |||
// const ACPGriffon = require('./js/ACPGriffon'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments on this file:
- Usually, we have our
index.js
file live in thejs
directory. - Implement to be consistent with our other
index.js
files: https://github.com/adobe/react-native-acpanalytics/blob/master/js/index.js - Add copyright header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved index.js to js and added copyright.
ios/Pods/DoubleConversion/LICENSE
Outdated
@@ -0,0 +1,26 @@ | |||
Copyright 2006-2011, the V8 project authors. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not be checking in our pods, and additionally, we shouldn't be checking in an Xcode project which references pods. This will cause build issues for our customers and require them to download all the pods.
- Remove pods and add them to git ignore
- Before committing run
pod deintegrate
@@ -0,0 +1,10 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
@@ -0,0 +1,29 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright header
|
||
|
||
RCT_EXPORT_METHOD(startSession: (NSString *) url){ | ||
[ACPGriffon startSession:[[NSURL alloc] initWithString:url]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Griffon's headers specifies that url
should be Nonnull
, we should do a check here to ensure it is not nil
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the nil check.
@@ -0,0 +1,15 @@ | |||
package com.griffonsample; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be sure to add the copyright header to all the files, including those in the sample app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
package.json
Outdated
"author": "", | ||
"license": "", | ||
"peerDependencies": { | ||
"react-native": ">=0.44.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add "@adobe/react-native-acpcore": ">=1.0.0"
as a peer dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added core as peer dependency.
@@ -0,0 +1,27 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be sure to copy the pre-publish script: https://github.com/adobe/react-native-acpanalytics/blob/master/package.json#L8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
package.json
Outdated
{ | ||
"name": "@adobe/react-native-acpgriffon", | ||
"version": "1.0.0", | ||
"description": "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Populate the metadata to be similar to that in other packages: https://github.com/adobe/react-native-acpanalytics/blob/master/package.json#L8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -0,0 +1,19 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
js/ACPGriffon.js
Outdated
Alert.alert("----- "+NativeModules); | ||
const ACPGriffon = NativeModules.ACPGriffon; | ||
|
||
// Alert.alert("{}{}{}{}"+JSON.stringify(NativeModules)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
js/ACPGriffon.js
Outdated
@@ -0,0 +1,19 @@ | |||
|
|||
import { NativeModules, Alert } from 'react-native'; | |||
Alert.alert("----- "+NativeModules); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused code, also remove the Alert
import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
js/ACPGriffon.js
Outdated
return Promise.resolve(ACPGriffon.getExtensionVersion()); | ||
}, | ||
registerExtension: () => { | ||
return Promis.resolve(ACPGriffon.registerExtension()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our other register extension APIs don't resolve a promise as it doesn't have a return value: https://github.com/adobe/react-native-acpanalytics/blob/master/js/ACPAnalytics.js#L32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the Promise.
RCTACPGriffon.podspec
Outdated
s.license = "Apache 2.0 License" | ||
s.platform = :ios, "10.0" | ||
|
||
s.source = { :git => "https://github.com/adobe/react-native-acp-griffon", :tag => "#{s.version}" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt this be react-native-acpgriffon
…android lib from sample app.
…dge class to set current activity to Griffon. This is to handle Griffon issue where Griffon fails to show PincodeNetryActivity for first time.
…griffon into acp-griffon Merged the remote branch.
…eed to be registered from Native code Application/AppDelegate in android and ios respectively which is recommended in RN.
…griffon into acp-griffon Merged remote branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks really good just a few comments.
README.md
Outdated
|
||
###### **iOS** | ||
```objective-c | ||
#import <RCTACPAnalytics/ACPAnalytics.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed to change that. Fixed
README.md
Outdated
|
||
###### **Android:** | ||
```java | ||
import com.adobe.marketing.mobile.Analytics; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -0,0 +1,18 @@ | |||
import { NativeModules } from 'react-native'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add copyright header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
3D83B4BD247E5608007E783A /* libACPGriffon_iOS.a */, | ||
3D83B4BB247E55F5007E783A /* ACPGriffon.h */, | ||
134814211AA4EA7D00B7C361 /* Products */, | ||
BFD6951DDA7DCA909FD456A9 /* Pods */, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove references to Pods
in our project before commiting it. Try pod deintegrate
, you may need to go into the project and delete the Pods folder manually. This can cause build issues in cusutomers apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deintegrated the pods.
super.onCreate(); | ||
SoLoader.init(this, /* native exopackage */ false); | ||
MobileCore.setApplication(this); // add this line | ||
MobileCore.configureWithAppID("94f571f308d5/e30a9514788b/launch-44fec1a705f1-development"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't commit app Ids to public git. Remove and add a place holder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced with placeholders.
[self.window makeKeyAndVisible]; | ||
|
||
//Register ACP Core and Griffon Extensions. | ||
[ACPCore configureWithAppId:@"94f571f308d5/e30a9514788b/launch-44fec1a705f1-development"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add placeholder for app id
sample/ACPGriffonSample/js/App.js
Outdated
const RNACPCore = require('@adobe/react-native-acpcore'); | ||
const ACPCore = RNACPCore.ACPCore; | ||
// import { ACPGriffon } from '@adobe/react-native-acpgriffon'; | ||
// const RNACPGriffon = require('@adobe/react-native-acpgriffon'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we clean up these imports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Added other react native plugin info in Readme.
…griffon into acp-griffon Merge the remote branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Description
Contains the React Native Griffon plugin and sample app. There are few pending issues that I am working.
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: