- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将推送通知系统添加到react-native项目,并且尝试使用2.1.3版本的react-native-notifications。
我的package.json文件如下所示:
"dependencies": {
"@react-native-community/async-storage": "^1.6.3",
"jetifier": "^1.6.4",
"react": "16.8.6",
"react-native": "0.60.0",
"react-native-camera": "^3.11.1",
"react-native-elements": "^1.2.7",
"react-native-gesture-handler": "^1.5.1",
"react-native-notifications": "^2.1.3",
"react-native-permissions": "^2.0.3",
"react-native-qrcode-scanner": "^1.3.1",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "^1.0.0-beta.27",
"react-redux": "^5.1.2",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0",
"rn-fetch-blob": "^0.10.16"
},
"devDependencies": {
"@babel/core": "7.5.0",
"@babel/runtime": "7.5.0",
"@react-native-community/eslint-config": "0.0.3",
"babel-jest": "24.8.0",
"eslint": "6.0.1",
"jest": "24.8.0",
"metro-react-native-babel-preset": "0.54.1",
"react-test-renderer": "16.8.6"
},
"jest": {
"preset": "react-native"
}
}
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.4.1")
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
jcenter()
}
}
subprojects { subproject ->
afterEvaluate {
if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
variantFilter { variant ->
def names = variant.flavors*.name
if (names.contains("reactNative59")) {
setIgnore(true)
}
}
}
}
}
}
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
apply plugin: 'com.android.library'
apply from: '../prepare-robolectric.gradle'
android {
compileSdkVersion 27
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
testOptions {
unitTests.all { t ->
reports {
html.enabled true
}
testLogging {
events "PASSED", "SKIPPED", "FAILED", "standardOut", "standardError"
}
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = " ${result.resultType} (${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped) "
def repeatLength = output.length()
println '\n\n' + ('-' * repeatLength) + '\n' + output + '\n' + ('-' * repeatLength) + '\n'
println "see report at file://${t.reports.html.destination}/index.html"
}
}
}
}
flavorDimensions "RNNotifications.reactNativeVersion"
productFlavors {
reactNative59 {
dimension "RNNotifications.reactNativeVersion"
}
reactNative60 {
dimension "RNNotifications.reactNativeVersion"
}
}
}
dependencies {
implementation "com.google.firebase:firebase-messaging:17.3.0"
implementation 'com.facebook.react:react-native:+'
// tests
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:3.5.1'
testImplementation 'org.assertj:assertj-core:3.8.0'
testImplementation 'com.squareup.assertj:assertj-android:1.1.1'
testImplementation 'org.mockito:mockito-core:2.13.0'
}
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
public ArrayList<ReactPackage> getPackages() {
return new ArrayList<>(Arrays.<ReactPackage>asList(
new MainReactPackage(),
new AsyncStoragePackage(),
new RNCameraPackage(),
new RNGestureHandlerPackage(),
new RNPermissionsPackage(),
new VectorIconsPackage(),
new RNFetchBlobPackage()
));
}
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:react-native-notifications] Project-Root\node_modules\react-native-notifications\an
droid\app\build\intermediates\library_manifest\reactNative60Debug\AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 19,
or use tools:overrideLibrary="com.wix.reactnativenotifications" to force usage (may lead to runtime failures)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 14s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (Project-Root\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:75:39)
at buildAndRun (Project-Root\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:137:41)
at Project-Root\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:103:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (Project-Root\node_modules\react-native\node_modules\@react-native-community\cli\build\cliEntry.js:160:7)
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more de
tails.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:\Users\nvashakidze\dev\BRAND-NEW\Micromeritics-Final\android\app\build\generated\rncli\src\main\java\com\facebook\react\PackageList.java:66: error: constructor RNNotificationsPackage in class RNNotificationsPackage cannot be applied
to given types;
new RNNotificationsPackage(),
^
required: Application
found: no arguments
reason: actual and formal argument lists differ in length
1 error
最佳答案
您必须传递应用程序上下文。作为引用,请检查此https://github.com/wix/react-native-notifications/blob/master/docs/installation.md#-android
关于android - minSdk兼容性错误使用react-native 0.60.0设置react-native-notifications@2.1.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59276585/
我遵循了提供的文档 here并且可以在 Android N 及更高版本上成功创建通知组。然而,我遇到的问题是 Android Oreo,每个发布到群组的通知都会为群组播放声音。 这很烦人,因为我只想播
单点触控 当应用程序返回前台时,我需要激活的 ViewController 来了解这一点。 是否有一个事件或覆盖我可以用来确定 View 被带到前台。 我确实找到了“WillEnterForegrou
我正在尝试在我的项目中创建一个通知系统。 这些是我已经完成的步骤: 1-php artisan notifications:table 2-php artisan migrate 3-php arti
我想知道如何批量发送推送通知。我们从以下3个主要模式来看问题: 一次API调用->一条消息->发送给指定用户 一次 API 调用 -> 一条消息 -> 传递给许多不同的用户(由 id 指定) 一个 A
我想在用户点击保存或删除按钮时显示通知。 Here is what i use for it.(Kendo notification) 我认为我的 CSS 部分有问题,我更改了很多东西但我仍然在原地。
在我的测试代码中,我使用了 notification.flags |= Notification.DEFAULT_SOUND; notification.flags |= No
当 Redis Sentinel 通知事件时,它不会提供 Redis 主节点的名称。 配置摘录: # sentinel notification-script # # Call the speci
Microsoft Exchange 引入了流通知作为 Exchange 2010 中拉/推通知的替代方法。有关流的基本介绍可以在此 msdn article 上找到。和 blog 但是,我无法弄清楚
我在理解WebExtensions notification.onClicked事件的文档时遇到问题。 最终,我要在单击通知时将通知文本复制到剪贴板。但是,现在我在理解回调内容或必须在其中插入noti
我即将实现ionic-native Push Notifications .这可以在浏览器中运行吗?还是我需要安装 iOS/Android 模拟器? 最佳答案 除非您使用 Phonegap 推送服务器
Safari 12.1 是否支持服务 worker PWA 推送通知?我试过这个 demo在 iOS 上,但它仍然不适合我。 有机会得到它们吗?谢谢。 最佳答案 目前没有关于此功能的通信...Appl
我遇到了一个奇怪的错误。一段时间以来,这种崩溃一直在我的 Fabric 中出现 致命异常:android.app.RemoteServiceException:startForeground 的错误通
我正在使用 Google Cloud Messaging 在 iOS 应用中接收推送通知。为了了解该系统的可靠性,我进行了两项测试。1.当应用程序处于前台时接收通知 下面称为curl 12. 当应用程
String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationM
我想在我的 Android 应用程序中使用 Notification,但我不知道 Android 中的 Notification 和 Push Notification 有什么区别. 我在网上搜索了这
我有两个模型之间的多对多关系: 用户 namespace App\Models; class User extends Model { use HasApiTokens, Notifiable
我在 App Store 中有一个 iPad 应用程序,其逻辑主要依赖于本地通知。换句话说,应用程序内部发生的很多事情都是由委托(delegate)方法应用程序 didReceiveLocalNoti
我知道如何制作每天在特定时间触发的本地通知。但是如何为每个通知更改 UNMutableNotificationContent.Body? 现在它只是一遍又一遍地显示相同的文本。 我正在为 iOS 10
请问,是否可以在没有用户 ID 的情况下发送推送通知?假设我们想向所有下载了我们应用程序的用户发送推送消息。或者出于安全原因,用户 ID 不能存储在数据库中(或在应用程序中使用)。 最佳答案 不管怎样
我在使用 Twilio notify 发送通知时遇到异常。 当我在使用相同的 Twilio NotificationCreator bean 发送 SMS 后发送通知时,如果我发送通知而不发送 SMS
我是一名优秀的程序员,十分优秀!