Code Monkey home page Code Monkey logo

Comments (25)

liz1113012618 avatar liz1113012618 commented on July 20, 2024

我已经将appkey导到jpush-react-native/android/build.gradle下了,但是感觉为什么没起作用啊

from jpush-react-native.

KenChoi1992 avatar KenChoi1992 commented on July 20, 2024

@liz1113012618 配置好后,运行,然后先调用 initPush() 具体可以看 demo 如何使用

from jpush-react-native.

liz1113012618 avatar liz1113012618 commented on July 20, 2024

下载为什么demo运行不起来啊

from jpush-react-native.

KenChoi1992 avatar KenChoi1992 commented on July 20, 2024

@liz1113012618 你用的 rn 版本是多少?如果是新版本,要在ReactInstanceManager的构造方法中 加上一句 .setUseOldBridge(true)

from jpush-react-native.

liz1113012618 avatar liz1113012618 commented on July 20, 2024

"react-native": "^0.20.0"

from jpush-react-native.

liz1113012618 avatar liz1113012618 commented on July 20, 2024

请问 register jpush是在那里啊,配置好后运行,感觉是客户端没有注册

from jpush-react-native.

KenChoi1992 avatar KenChoi1992 commented on July 20, 2024

客户端没有注册这一说法,只要正确配置了,安装运行后就会自动注册,而不需要你手动注册。

from jpush-react-native.

jerry81333 avatar jerry81333 commented on July 20, 2024

能详细解释下“ReactInstanceManager的构造方法中 加上一句 .setUseOldBridge(true)”这个步骤吗、、、本人新手,问题也相似,ReactInstanceManager是否指的是\node_modules\react-native\ReactAndroid\src\main\java\com\facebook\react中的ReactInstanceManager.java文件。
如果是,里面没有构造函数,是否需要自行添加:
public ReactInstanceManager()
{
this.setUseOldBridge(true);
}
以上添加方式是否可行?
麻烦你了 @KenChoi1992

from jpush-react-native.

liz1113012618 avatar liz1113012618 commented on July 20, 2024

请问申请APPKey的包名是指applicationid吧,我是这么理解的,然后在app里的MainActivity配置如下图
58040e2f-9046-45fc-a2fb-905bf5e9ee70
请问这些配置可以么,还有"react-native": "^0.20.0"里没有ReactInstanceManager怎么办呢?
谢谢了

from jpush-react-native.

KenChoi1992 avatar KenChoi1992 commented on July 20, 2024

@liz1113012618 0.20.0有的,可以参考 MainActivity注释的代码

from jpush-react-native.

KenChoi1992 avatar KenChoi1992 commented on July 20, 2024

@jerry81333 看一下注释代码, 在 MainActivity 里面

from jpush-react-native.

liz1113012618 avatar liz1113012618 commented on July 20, 2024

我参考MainActivity里的代码修改,虽然初始化成功了(Init push success),还是无法接受推送消息 或者说无法发送推送消息
f37df91f-a112-42cc-a5e5-8decb3d96e75

from jpush-react-native.

KenChoi1992 avatar KenChoi1992 commented on July 20, 2024

@liz1113012618 AppKey替换了吗,另外还有 applicationId 也要换为自己的

from jpush-react-native.

jerry81333 avatar jerry81333 commented on July 20, 2024

MainActivity已经全部替换成Demo中的,并且ReactInstanceManager下加上了.setUseOldBridge(true),但是依旧还是不行。
另外applicationId不是GetApplicationID方法获取的吗,内部不是只需要替换AppKey和app_channel就行吗、、、
如果不是,那需要怎么配? @KenChoi1992

from jpush-react-native.

KenChoi1992 avatar KenChoi1992 commented on July 20, 2024

@jerry81333 我说的是在你的 build.gradle 下声明一下 applicationId,参考 demo 的 build.gradle 文件,另外你报错的日志可以看一下吗?

from jpush-react-native.

jerry81333 avatar jerry81333 commented on July 20, 2024

@KenChoi1992 问题是,并没有任何报错日志啊,applicationId不需要改因为本就是我自己新建的项目,只是参考了Demo的代码、、、
这是我的RN的版本号:
react-native-cli: 1.0.0
react-native: 0.27.2
根据文档配置后,demo中APPKEY,IMEI等参数均能显示,但是点击INITPUSH后再点击GetApplicationID,毫无反应。chrome debug调试中,只能拿到stoppush和resumepush的反馈,initpush和GetApplicationID均无反馈。
后台推送报错和这个问题的提问者相同。

from jpush-react-native.

KenChoi1992 avatar KenChoi1992 commented on July 20, 2024

@jerry81333 @liz1113012618我们的社区问一下吧,我这里就这几个配置,都弄好了是可以运行的,我不知道你们这个是什么问题。

from jpush-react-native.

jerry81333 avatar jerry81333 commented on July 20, 2024

感觉就是服务器与app没有任何交互,刚才截包看了下,所有操作app没有发送或接受任何数据包、、、 @KenChoi1992

from jpush-react-native.

KenChoi1992 avatar KenChoi1992 commented on July 20, 2024

@jerry81333 @liz1113012618 如果是 SDK 的问题,你们看看有没有 jpush集成失败的相关日志

from jpush-react-native.

jerry81333 avatar jerry81333 commented on July 20, 2024

@KenChoi1992 你提醒了我,是不是因为这个?npm.debug日志
3662 verbose stack Error: The package [email protected] does not satisfy its siblings' peerDependencies requirements!
3662 verbose stack at C:\Program Files\nodejs\node_modules\npm\lib\install.js:125:32
3662 verbose stack at C:\Program Files\nodejs\node_modules\npm\lib\install.js:268:7
3662 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-installed\read-installed.js:142:5
3662 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-installed\read-installed.js:263:14
3662 verbose stack at cb (C:\Program Files\nodejs\node_modules\npm\node_modules\slide\lib\async-map.js:47:24)
3662 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-installed\read-installed.js:263:14
3662 verbose stack at cb (C:\Program Files\nodejs\node_modules\npm\node_modules\slide\lib\async-map.js:47:24)
3662 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-installed\read-installed.js:263:14
3662 verbose stack at cb (C:\Program Files\nodejs\node_modules\npm\node_modules\slide\lib\async-map.js:47:24)
3662 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-installed\read-installed.js:263:14
3663 verbose cwd H:\ZH\s4app-master-659d3e812a72bab94684b170b131c50b5e7d1da0
3664 error Windows_NT 10.0.10586
3665 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "jpush-react-native" "--save"
3666 error node v4.4.5
3667 error npm v2.15.5
3668 error code EPEERINVALID
3669 error peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
3669 error peerinvalid Peer [email protected] wants [email protected]
3670 verbose exit [ 1, true ]

from jpush-react-native.

KenChoi1992 avatar KenChoi1992 commented on July 20, 2024

@jerry81333 升级一下 react 版本

from jpush-react-native.

liz1113012618 avatar liz1113012618 commented on July 20, 2024

我觉得是将jpush-react-plugin当插件集成到自己项目中,所有的配置都在插件中,而自己的项目并没有引用SDK的核心功能,比如:







@jerry81333 这部分就没有用到,请问有解决方案么?

from jpush-react-native.

KenChoi1992 avatar KenChoi1992 commented on July 20, 2024

@liz1113012618 你在 JS 中调用我们插件的方法就已经使用了 SDK 提供的功能了,你自己项目的 AndroidManifest 并不需要配置,我们的插件配置好了,你们要配置的就是 AppKey、applicationId 以及 build.gradle、settings.gradle 中的项目依赖,ReadMe 写的很清楚。

from jpush-react-native.

liz1113012618 avatar liz1113012618 commented on July 20, 2024

请问 AppKey 是在jpush-react-native/android/build.gradle中配置对吧,那生成AppKey的包名是插件的包名还是自己生成项目的包名啊?
在jpush-react-native/android/build.gradle中是无法添加applicationId的,那请问application怎么配置的啊? @KenChoi1992

from jpush-react-native.

KenChoi1992 avatar KenChoi1992 commented on July 20, 2024

@liz1113012618 不是,你看一下 ReadMe,写的是 your react native project/android/app/build.gradle 而不是 jpush-react-native/android/build.gradle,另外 AppKey 是你在极光控制台申请了应用后生成的,如果还不懂,就看看官网文档。

from jpush-react-native.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.