ios - React-native-firebase Bigimage 无法在 ios 中工作

标签 ios react-native react-native-firebase rich-notifications

当应用程序关闭或打开时,我无法在 ios 的通知中显示大图像,但在 android 中工作

var display_notification = new firebase.notifications.Notification({
    show_in_foreground: true
  })
    .setNotificationId(notification._notificationId)
    .setTitle(notification._title)
    .setBody(notification._body)
    .setData(notification._data);
  if (Platform.OS == "android") {
    display_notification.android
      .setChannelId("fcm_default_channel")
      .android.setSmallIcon("ic_notification")
      .android.setBigPicture(notification._data.picture)
      .android.setColor("#171551");
  } else {
    display_notification.ios.addAttachment(
      "1",
      "https://files.allaboutbirds.net/wp-content/uploads/2015/06/prow-featured.jpg"
    );
  }

在 ios 中显示通知但不显示大图像(丰富通知)

最佳答案

您可以使用IOSNotification

iOS 特定通知设置。

NOTE: Some of these settings apply only to iOS 9, or iOS 10+. These are flagged as appropriate.

launchImage returns nullable string;

获取与通知一起使用的启动图像。

setLaunchImage(launchImage) returns Notification;

设置通知的启动图像。

launchImage : string

例子

notification
  .ios.setLaunchImage('notificationimage.png');

Description of IOSNotification

Description of Displaying Notifications

关于ios - React-native-firebase Bigimage 无法在 ios 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57222330/

相关文章:

ios - 我向 NSUserDefaults.synchronize() 传递什么参数?

javascript - React navigation didfocus 事件监听器在类组件和功能组件之间的工作方式不同

react-native - 尝试在 React-Native Firebase 中使用电话身份验证时,iOS 模拟器中的应用程序崩溃

ios - React Native Firebase 更新到 5.0.0 ios 错误

javascript - NativeFirebaseError : [storage/unauthorized] User is not authorized to perform the desired action

ios - NSLocalizedString 返回无处定义的文本

ios - 同时分别为图层变换的旋转和缩放比例设置不同的持续时间

react-native - 使用 react Native 按下按钮后打开 WebView

javascript - 当 catch 存在时,可能会出现未处理的 promise 拒绝

ios - 为什么我在表中插入值时 coredata 返回空数组