Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
react-native-device-info
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
放牛的园子
react-native-device-info
Commits
20c62623
Commit
20c62623
authored
Sep 21, 2017
by
Douglas Nassif Roma Junior
Committed by
GitHub
Sep 21, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5 from douglasjunior/patch-3
Make 'com.google.android.gms:play-services-gcm' use optional.
parents
3372e8a0
a337a40a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
RNDeviceModule.java
...c/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java
+5
-3
No files found.
android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java
View file @
20c62623
...
...
@@ -12,8 +12,6 @@ import android.provider.Settings.Secure;
import
android.webkit.WebSettings
;
import
android.telephony.TelephonyManager
;
import
com.google.android.gms.iid.InstanceID
;
import
com.facebook.react.bridge.ReactApplicationContext
;
import
com.facebook.react.bridge.ReactContextBaseJavaModule
;
import
com.facebook.react.bridge.ReactMethod
;
...
...
@@ -114,7 +112,11 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
e
.
printStackTrace
();
}
constants
.
put
(
"instanceId"
,
InstanceID
.
getInstance
(
this
.
reactContext
).
getId
());
try
{
if
(
Class
.
forName
(
"com.google.android.gms.iid.InstanceID"
)
!=
null
)
{
constants
.
put
(
"instanceId"
,
com
.
google
.
android
.
gms
.
iid
.
InstanceID
.
getInstance
(
this
.
reactContext
).
getId
());
}
}
catch
(
ClassNotFoundException
e
)
{}
constants
.
put
(
"deviceName"
,
deviceName
);
constants
.
put
(
"systemName"
,
"Android"
);
constants
.
put
(
"systemVersion"
,
Build
.
VERSION
.
RELEASE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment