⚠️ Warning! This library is a fork from a discontinued library. The original project was at Pilloxa/react-native-nordic-dfu. Our fork is built off a more up-to-date fork from DomiR/react-native-nordic-dfu that works with Android 14. The quip fork should also now work with iOS 17.
This library allows you to perform a Device Firmware Update (DFU) of your nrf51 or nrf52 chip from Nordic Semiconductor. It is tested on both iOS (17) and Android (14).
For more info about the DFU process, see: Resources.
Please keep in mind the our availability to maintain this fork is limited and is based on our project needs.
Install and link the NPM package per usual with
npm install --save https://github.com/getquip/react-native-nordic-dfu
or
yarn add https://github.com/getquip/react-native-nordic-dfu
The iOS project is written in Objective-C. You'll need to add the following to Podfile
and AppDelegate.mm
. Please see the iOS example project.
Podfile
:
static_frameworks = ['iOSDFULibrary']
pre_install do |installer|
installer.pod_targets.each do |pod|
if static_frameworks.include?(pod.name)
puts "Overriding the static_frameworks? method for #{pod.name}"
def pod.build_type;
Pod::BuildType.new(:linkage => :static, :packaging => :framework)
end
end
end
end
target "YourApp" do
# ...
pod "react-native-nordic-dfu", path: "../node_modules/@getquip/react-native-nordic-dfu"
# ...
end
AppDelegate.mm
:
// ...
#import "RNNordicDfu.h"
// ...
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// ...
[RNNordicDfu setCentralManagerGetter:^() {
return [[CBCentralManager alloc] initWithDelegate:nil queue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0)];
}];
// Reset manager delegate since the Nordic DFU lib "steals" control over it
[RNNordicDfu setOnDFUComplete:^() {
NSLog(@"onDFUComplete");
}];
[RNNordicDfu setOnDFUError:^() {
NSLog(@"onDFUError");
}];
// ...
}
Android does not require any special setup. Please see the Android example project.
This example assumes you already have the basics installed to run cocapods, gradle, java, etc. Note that you must setup the xcode project with the correct Signing & Capabilities.
cd example
yarn setup
- Go to
example/App.tsx
- Update the
filePath
variable with the link to the firmware file - Update the
BleManagerService.init('', '');
function with the DFU Service & the device name - Press
Connect to Device in Area
button - When you see some small info about the device on the screen Press the
Start Update
- If you have any problems connecting to the Device pleas consult the react-native-ble-manager
- Legacy DFU Introduction
- Secure DFU Introduction
- nRF51 Development Kit (DK) (compatible with Arduino Uno Revision 3)
- nRF52 Development Kit (DK) (compatible with Arduino Uno Revision 3)
- nRF52840 Development Kit (DK) (compatible with Arduino Uno Revision 3)