This repository was archived by the owner on May 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implementation first pass #1
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a86e03d
Add React Native library stub
b4e1c59
Update code names from prototype
0e4663f
Link HybridMobileDeploy module into HybridMobileDeployCompanion examp…
3037634
Integrate module with Companion example app
495eec1
Update react-native to 0.8.0-rc
3a68546
Remove generated main.jsbundle and ignore it
701dc58
Fix typo in HybridMobileDeploy.ios.js
99d2aed
Add (hacky) reference to SDK package
2e39fbf
Add temporary fetch adapter for use by the SDK
45048f5
Update HybridMobileDeploy js api with basic update query
d07b96a
Update example to use new HybridMobileDeploy implementation
97be986
Add basic readme
896eb36
Update appBundleUrl so it can be called with no params
03965e9
Use new method for requiring NativeModules
568ab4b
Update how example app loads react-native-hybrid-mobile-deploy
053c786
Update readme setup instructions
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,6 @@ DerivedData | |
# | ||
node_modules/ | ||
npm-debug.log | ||
|
||
# Don't publish example apps | ||
Examples/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,5 @@ DerivedData | |
# | ||
node_modules/ | ||
npm-debug.log | ||
|
||
main.jsbundle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Stub of UpdateManager for Android. | ||
* | ||
* @providesModule UpdateManager | ||
* @flow | ||
*/ | ||
'use strict'; | ||
|
||
var warning = require('warning'); | ||
|
||
var HybridMobileDeploy = { | ||
test: function() { | ||
warning("Not yet implemented for Android."); | ||
} | ||
}; | ||
|
||
module.exports = HybridMobileDeploy; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#import "RCTBridgeModule.h" | ||
|
||
@interface HybridMobileDeploy : NSObject <RCTBridgeModule> | ||
+ (NSString *) getBundlePath:(NSString*)bundleName; | ||
+ (NSURL *) getNativeBundleURL:(NSString*)bundleName; | ||
+ (NSURL *)appBundleUrl; | ||
+ (NSURL *)appBundleUrl:(NSString*)bundleName | ||
nativeBundleName:(NSString*)nativeBundleName; | ||
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* @providesModule HybridMobileDeploy | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var NativeHybridMobileDeploy = require('react-native').NativeModules.HybridMobileDeploy; | ||
var requestFetchAdapter = require("./request-fetch-adapter.js"); | ||
var semver = require('semver'); | ||
var Sdk = require("hybrid-mobile-deploy-sdk/script/acquisition-sdk"); | ||
var serverUrl; | ||
var appName; | ||
var sdk; | ||
|
||
var HybridMobileDeploy = { | ||
queryUpdate: function(cb) { | ||
var pkg = {nativeVersion: "1.2.3", scriptVersion: "1.2.0"}; | ||
sdk.queryUpdateWithCurrentPackage(pkg, cb); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I am not mistaken, this would change with my changes to consume packageHash. we will need to pass.. deploymentKey and appVersion(nativeVersion) to get the update. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. This PR targets the sdk/api from earlier last week, so there are a few things that will need to be updated. I'm working on some of those updates, but I want to get this merged so we have a baseline to work from. |
||
}, | ||
installUpdate: function(update) { | ||
NativeHybridMobileDeploy.installUpdateFromUrl(update.updateUrl, update.bundleName, (err) => console.log(err), () => console.log("success")); | ||
} | ||
}; | ||
|
||
module.exports = function(serverUrl, deploymentKey, ignoreNativeVersion) { | ||
sdk = new Sdk(requestFetchAdapter, { | ||
serverUrl: serverUrl, | ||
deploymentKey: deploymentKey, | ||
ignoreNativeVersion: ignoreNativeVersion | ||
}); | ||
return HybridMobileDeploy; | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
what script is this? why do you need it?
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.
The packager.sh is shipped with React Native, and is used to package all the JS files. I had to add an extra "root" to the package because it doesn't currently support symlinks, so "npm link"ing the core library into the example's node_modules wouldn't work.