File tree Expand file tree Collapse file tree 6 files changed +86
-4
lines changed Expand file tree Collapse file tree 6 files changed +86
-4
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " branch-cordova-sdk" ,
3
3
"description" : " Branch Metrics Cordova SDK" ,
4
4
"main" : " src/index.js" ,
5
- "version" : " 4.2.1 " ,
5
+ "version" : " 4.2.2 " ,
6
6
"homepage" : " https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking" ,
7
7
"repository" : {
8
8
"type" : " git" ,
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ SOFTWARE.
24
24
<plugin xmlns =" http://apache.org/cordova/ns/plugins/1.0"
25
25
xmlns : android =" http://schemas.android.com/apk/res/android"
26
26
id =" branch-cordova-sdk"
27
- version =" 4.2.1 " >
27
+ version =" 4.2.2 " >
28
28
29
29
<!-- Description -->
30
30
<name >branch-cordova-sdk</name >
@@ -63,7 +63,7 @@ SOFTWARE.
63
63
<!-- Manifest configuration is done via a js script. We should move it to this config in the future. -->
64
64
65
65
<source-file src =" src/android/io/branch/BranchSDK.java" target-dir =" src/io/branch" />
66
- <framework src =" io.branch.sdk.android:library:4.4.0 " />
66
+ <framework src =" io.branch.sdk.android:library:5.0.7 " />
67
67
</platform >
68
68
69
69
<!-- iOS -->
@@ -87,7 +87,7 @@ SOFTWARE.
87
87
<source url =" https://github.com/CocoaPods/Specs.git" />
88
88
</config >
89
89
<pods >
90
- <pod name =" Branch" spec =" ~> 0.35.0 " />
90
+ <pod name =" Branch" spec =" ~> 1.39.2 " />
91
91
</pods >
92
92
</podspec >
93
93
</platform >
Original file line number Diff line number Diff line change
1
+ ( function ( ) {
2
+ // properties
3
+
4
+ const fs = require ( "fs" ) ;
5
+ const path = require ( "path" ) ;
6
+
7
+ // entry
8
+ module . exports = {
9
+ addBranchJson : addBranchJson
10
+ } ;
11
+
12
+ // updates the platforms/ios/*.xcodeproj/project.pbxproj file and adds branch.json file
13
+ function addBranchJson ( context , preferences ) {
14
+ if ( preferences . branchJson . exists ) {
15
+ const destination = path . join (
16
+ context . opts . projectRoot ,
17
+ "platforms" ,
18
+ "android" ,
19
+ "app" ,
20
+ "src" ,
21
+ "main" ,
22
+ "assets" ,
23
+ "branch.json"
24
+ ) ;
25
+ fs . copyFileSync ( preferences . branchJson . path , destination ) ;
26
+ }
27
+ }
28
+ } ) ( ) ;
Original file line number Diff line number Diff line change 5
5
const iosPlist = require ( "../ios/updatePlist.js" ) ;
6
6
const iosAssociatedDomains = require ( "../ios/updateAssociatedDomains.js" ) ;
7
7
const iosHeaderPaths = require ( "../ios/updateHeaderPaths.js" ) ;
8
+ const iosPbxproj = require ( "../ios/updatePbxproj.js" ) ;
9
+ const androidAssets = require ( "../android/updateAssets.js" ) ;
8
10
const IOS = "ios" ;
11
+ const ANDROID = "android" ;
9
12
10
13
// entry
11
14
module . exports = run ;
16
19
const platforms = context . opts . cordova . platforms ;
17
20
18
21
platforms . forEach ( platform => {
22
+ if ( platform === ANDROID ) {
23
+ androidAssets . addBranchJson ( context , preferences ) ;
24
+ }
25
+
19
26
if ( platform === IOS ) {
20
27
iosPlist . addBranchSettings ( preferences ) ;
21
28
iosAssociatedDomains . addAssociatedDomains ( preferences ) ;
22
29
iosHeaderPaths . addHeaderPaths ( ) ;
30
+ iosPbxproj . addBranchJson ( context , preferences ) ;
23
31
}
24
32
} ) ;
25
33
}
Original file line number Diff line number Diff line change
1
+ ( function ( ) {
2
+ // properties
3
+
4
+ const fs = require ( "fs" ) ;
5
+ const path = require ( "path" ) ;
6
+
7
+ // entry
8
+ module . exports = {
9
+ addBranchJson : addBranchJson
10
+ } ;
11
+
12
+ // updates the platforms/ios/*.xcodeproj/project.pbxproj file and adds branch.json file
13
+ function addBranchJson ( context , preferences ) {
14
+ if ( preferences . branchJson . exists && preferences . iosProjectModule . xcode ) {
15
+ const destination = path . join (
16
+ context . opts . projectRoot ,
17
+ "platforms" ,
18
+ "ios" ,
19
+ "branch.json"
20
+ ) ;
21
+ fs . copyFileSync ( preferences . branchJson . path , destination ) ;
22
+ preferences . iosProjectModule . xcode . addResourceFile ( destination ) ;
23
+ preferences . iosProjectModule . write ( ) ;
24
+ }
25
+ }
26
+ } ) ( ) ;
Original file line number Diff line number Diff line change 1
1
( function ( ) {
2
2
// properties
3
3
4
+ const fs = require ( "fs" ) ;
4
5
const path = require ( "path" ) ;
5
6
const xmlHelper = require ( "../lib/xmlHelper.js" ) ;
6
7
57
58
return {
58
59
projectRoot : getProjectRoot ( context ) ,
59
60
projectName : getProjectName ( configXml ) ,
61
+ branchJson : getBranchJson ( context ) ,
60
62
branchKey : getBranchKey ( branchXml , "branch-key-live" ) ,
61
63
branchKeyTest : getBranchValue ( branchXml , "branch-key-test" ) ,
62
64
branchTestMode : getBranchValue ( branchXml , "branch-test-mode" ) ,
96
98
return output ;
97
99
}
98
100
101
+ // Checks if branch.json exists in projectRoot and returns its path
102
+ function getBranchJson ( context ) {
103
+ const pathToBranchJson = path . join ( context . opts . projectRoot , "branch.json" ) ;
104
+ let exists ;
105
+
106
+ try {
107
+ fs . existsSync ( pathToBranchJson ) ;
108
+ exists = true ;
109
+ } catch ( err ) {
110
+ exists = false ;
111
+ }
112
+
113
+ return {
114
+ exists : exists ,
115
+ path : pathToBranchJson
116
+ } ;
117
+ }
118
+
99
119
// read branch value from <branch-config>
100
120
function getBranchValue ( branchXml , key ) {
101
121
return branchXml . hasOwnProperty ( key ) ? branchXml [ key ] [ 0 ] . $ . value : null ;
You can’t perform that action at this time.
0 commit comments