Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-notifications
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
冷佳娟
react-native-notifications
Commits
53df690c
Commit
53df690c
authored
Mar 07, 2017
by
Amit Davidi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the (unprotected) VIBRATE permission on Android to support vibration on old devices
parent
a83c578c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
android/src/main/AndroidManifest.xml
android/src/main/AndroidManifest.xml
+3
-0
example/android/myapplication/src/main/java/com/wix/reactnativenotifications/app/MainActivity.java
...va/com/wix/reactnativenotifications/app/MainActivity.java
+4
-1
example/android/myapplication/src/main/res/layout/activity_main.xml
...droid/myapplication/src/main/res/layout/activity_main.xml
+2
-1
example/android/myapplication/src/main/res/layout/activity_main_prelollipop.xml
...ication/src/main/res/layout/activity_main_prelollipop.xml
+10
-0
No files found.
android/src/main/AndroidManifest.xml
View file @
53df690c
...
...
@@ -11,6 +11,9 @@
android:protectionLevel=
"signature"
/>
<uses-permission
android:name=
"${applicationId}.permission.C2D_MESSAGE"
/>
<!-- Ref: http://stackoverflow.com/questions/13602190/java-lang-securityexception-requires-vibrate-permission-on-jelly-bean-4-2 -->
<uses-permission
android:name=
"android.permission.VIBRATE"
android:maxSdkVersion=
"18"
/>
<application>
<!--
...
...
example/android/myapplication/src/main/java/com/wix/reactnativenotifications/app/MainActivity.java
View file @
53df690c
...
...
@@ -24,10 +24,13 @@ public class MainActivity extends ReactActivity {
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
final
ViewGroup
layout
=
(
ViewGroup
)
getLayoutInflater
().
inflate
(
R
.
layout
.
activity_main
,
null
)
;
ViewGroup
layout
;
if
(
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
layout
=
(
ViewGroup
)
getLayoutInflater
().
inflate
(
R
.
layout
.
activity_main
,
null
);
Toolbar
toolbar
=
(
Toolbar
)
layout
.
findViewById
(
R
.
id
.
toolbar
);
setActionBar
(
toolbar
);
}
else
{
layout
=
(
ViewGroup
)
getLayoutInflater
().
inflate
(
R
.
layout
.
activity_main_prelollipop
,
null
);
}
mReactRootView
=
new
ReactRootView
(
this
);
layout
.
addView
(
mReactRootView
);
...
...
example/android/myapplication/src/main/res/layout/activity_main.xml
View file @
53df690c
...
...
@@ -11,7 +11,8 @@
<android.support.design.widget.AppBarLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:theme=
"@style/AppTheme.AppBarOverlay"
>
android:theme=
"@style/AppTheme.AppBarOverlay"
>
<android.widget.Toolbar
android:id=
"@+id/toolbar"
android:layout_width=
"match_parent"
...
...
example/android/myapplication/src/main/res/layout/activity_main_prelollipop.xml
0 → 100644
View file @
53df690c
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:fitsSystemWindows=
"true"
tools:context=
"com.wix.reactnativenotifications.app.MainActivity"
>
</android.support.design.widget.CoordinatorLayout>
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