Commit 5d1ea2a3 authored by Rebecca Hughes's avatar Rebecca Hughes

Tweak some device name stuff and readme

parent 1c6d1e04
...@@ -75,6 +75,13 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand ...@@ -75,6 +75,13 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
(Thanks to @chirag04 for writing the instructions) (Thanks to @chirag04 for writing the instructions)
* If you want to get the device name in Android add this to your AndroidManifest.xml
```xml
...
<uses-permission android:name="android.permission.BLUETOOTH"/>
```
## Release Notes ## Release Notes
0.5.0 adds a new parameter; Device Id. On iOS this is the hardware string for the current device (e.g. 0.5.0 adds a new parameter; Device Id. On iOS this is the hardware string for the current device (e.g.
...@@ -107,4 +114,6 @@ console.log("App Version", DeviceInfo.getVersion()); // e.g. 1.1.0 ...@@ -107,4 +114,6 @@ console.log("App Version", DeviceInfo.getVersion()); // e.g. 1.1.0
console.log("App Version (Readable)", DeviceInfo.getReadableVersion()); // e.g. 1.1.0.89 console.log("App Version (Readable)", DeviceInfo.getReadableVersion()); // e.g. 1.1.0.89
console.log("Device Name", DeviceInfo.getDeviceName()); // e.g. Becca's iPhone 6
``` ```
...@@ -13,6 +13,7 @@ import android.os.Build; ...@@ -13,6 +13,7 @@ import android.os.Build;
import android.provider.Settings.Secure; import android.provider.Settings.Secure;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.bluetooth.BluetoothAdapter;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -48,9 +49,9 @@ public class RNDeviceModule extends ReactContextBaseJavaModule { ...@@ -48,9 +49,9 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} }
String deviceName = "Unknown"; String deviceName = "Unknown";
try { try {
BluetoothAdapter myDevice = BluetoothAdapter.getDefaultAdapter(); BluetoothAdapter myDevice = BluetoothAdapter.getDefaultAdapter();
deviceName = myDevice.getName(); deviceName = myDevice.getName();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment