react-native-mparticle 2.7.10 → 2.7.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +29 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -30,15 +30,42 @@ $ npm install react-native-mparticle --save
30
30
 
31
31
  2. **Install the SDK** using CocoaPods:
32
32
 
33
+ The npm install step above will automatically include our react framework and the core iOS framework in your project. However depending on your app and its other dependecies you must integrate it in 1 of 3 ways
34
+
35
+ A. Static Libraries are the React Native default but since mParticle iOS contains swift code you need to add an exception for it in the from of a pre-install command in the Podfile.
33
36
  ```bash
34
- $ # Update your Podfile to be ready to use dynamically linked frameworks by commenting out the following line
35
- $ # :flipper_configuration => flipper_config,
37
+ pre_install do |installer|
38
+ installer.pod_targets.each do |pod|
39
+ if pod.name == 'mParticle-Apple-SDK'
40
+ def pod.build_type;
41
+ Pod::BuildType.new(:linkage => :dynamic, :packaging => :framework)
42
+ end
43
+ end
44
+ end
45
+ end
36
46
  ```
37
47
  Then run the following command
38
48
  ```
49
+ bundle exec pod install
50
+ ```
51
+
52
+ B&C. Frameworks are the default for Swift development and while it isn't preferred by React Native it is supported. Additionally you can define whether the frameworks are built staticly or dynamically.
53
+
54
+ Update your Podfile to be ready to use dynamically linked frameworks by commenting out the following line
55
+ ```bash
56
+ # :flipper_configuration => flipper_config,
57
+ ```
58
+ Then run either of the following commands
59
+ ```
60
+ $ USE_FRAMEWORKS=static bundle exec pod install
61
+ ```
62
+ or
63
+ ```
39
64
  $ USE_FRAMEWORKS=dynamic bundle exec pod install
40
65
  ```
41
66
 
67
+ 3. Import and start the mParticle Apple SDK into Swift or Objective-C.
68
+
42
69
  The mParticle SDK is initialized by calling the `startWithOptions` method within the `application:didFinishLaunchingWithOptions:` delegate call.
43
70
 
44
71
  Preferably the location of the initialization method call should be one of the last statements in the `application:didFinishLaunchingWithOptions:`.
@@ -49,9 +76,6 @@ The `startWithOptions` method requires an options argument containing your key a
49
76
 
50
77
  For more help, see [the iOS set up docs](https://docs.mparticle.com/developers/sdk/ios/getting-started/#create-an-input).
51
78
 
52
- 3. Import and start the mParticle Apple SDK into Swift or Objective-C.
53
-
54
-
55
79
  #### Swift Example
56
80
 
57
81
  ```swift
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "homepage": "https://www.mparticle.com",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "mParticle/react-native-mparticle",
7
- "version": "2.7.10",
7
+ "version": "2.7.11",
8
8
  "main": "js/index.js",
9
9
  "scripts": {
10
10
  "test": "./node_modules/standard/bin/cmd.js",