jpush / jpush/jpush-react-native

iOS的example害人

Open
#926 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.4k
Forks
348
PR merge metrics
No merged PRs in 30d

Description

你的运行环境

  • 插件版本:
  • react-native 版本:

期望效果

iOS 的 example 这里 这句 entity.types = JPAuthorizationOptionNone; 害人不浅,真机怎么都没有弹通知权限。

// APNS
  JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init];
  if (@available(iOS 12.0, *)) {
    entity.types = JPAuthorizationOptionNone; //JPAuthorizationOptionAlert|JPAuthorizationOptionBadge|JPAuthorizationOptionSou//nd|JPAuthorizationOptionProvidesAppNotificationSettings;
  }
  [JPUSHService registerForRemoteNotificationConfig:entity delegate:self];

再看看文档:https://docs.jiguang.cn/jpush/client/iOS/ios_jghgzy

WeChatWorkScreenshot_05708072-b991-45bf-b8d8-72ba9400d64e

需要改成下面这样就可以获取到通知权限了:

entity.types = JPAuthorizationOptionAlert|JPAuthorizationOptionBadge|JPAuthorizationOptionSound;

实际效果

没弹窗

重现步骤

  1. ...
  2. ...
  3. ...
  4. ...

Debug logs

包括 Android 或 iOS 的日志:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open example/ios/example/AppDelegate.m at the referenced registration code and compare the authorization options with the linked iOS documentation. Update the example so a real iOS device requests notification permission, then verify that the permission prompt appears.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c, react-native
Domain
mobile
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.