
RN
鳕鱼33
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
注销使用苹果登录的账号
注销使用AppleID登录的app原创 2022-10-14 16:53:55 · 561 阅读 · 0 评论 -
记录xcode和android调试器的报错合集
xcode1.旧版本升到新版本出现字体重复链接等问题error: Multiple commands produce '/Users/user/App/marathon-app-new/ios/build/marathonAppNew/Build/Products/Debug-iphonesimulator/marathonAppNew.app/Entypo.ttf':1) Target 'marathonAppNew' (project 'marathonAppNew') has copy comm原创 2022-03-04 14:44:49 · 670 阅读 · 1 评论 -
[RN]使用第三方登录(Facebook,Google,Apple)
Facebook登录import { AccessToken, LoginManager } from 'react-native-fbsdk-next';const facebookLogin = ()=>{ LoginManager.logInWithPermissions(['public_profile', 'email', 'user_birthday', 'user_gender']) .then( async (result) => { if (result.is原创 2022-02-23 14:57:33 · 1609 阅读 · 0 评论 -
[RN]安卓上gif图不动
在android/app/build.gradle中的dependencies中添加implementation 'com.facebook.fresco:animated-gif:2.0.0' // react native版本0.63.4原创 2022-02-22 18:40:21 · 1982 阅读 · 0 评论 -
[RN]react-native-video后台播放
https://www.jianshu.com/p/ca6dc155f485原创 2022-02-18 16:17:20 · 505 阅读 · 0 评论 -
[RN]使用react-native-image-zoom-viewer缩放图片显示器长按保存图片到相册功能失效
原因:插件源码使用的CameraRoll已从RN移除,需要另外添加@react-native-community/cameraroll使用ImageViewer提供的onSave回调实现保存:import path from 'react-native-path';import RNFetchBlob from 'rn-fetch-blob';import CameraRoll from "@react-native-community/cameraroll";import ImageView原创 2022-02-17 18:38:54 · 2217 阅读 · 0 评论 -
[RN]实现在系统播放器上控制app内的媒体播放
实现在系统播放器上控制app内的媒体播放原创 2022-02-17 17:51:41 · 2216 阅读 · 3 评论 -
[RN]安卓上谷歌登录报错“DEVELOPER_ERROR“
https://github.com/react-native-google-signin/google-signin/blob/master/docs/android-guide.md两种原因:1.如果使用了firebase,到firebase后台添加 SHA 凭证指纹,然后谷歌服务后台的 凭证 - OAuth 用戶端 ID 就会添加一个安卓的clientId2.使用GoogleSignin.configure()不要设置任何值注意:SHA-1的获取(注意是调试模式还是发布模式,一般):ht原创 2021-08-24 14:30:42 · 2958 阅读 · 0 评论 -
[RN] 实现下载功能
https://juejin.cn/post/6925818114974154765原创 2021-08-19 18:49:42 · 307 阅读 · 0 评论 -
[RN]ScrollView嵌套FlatList在安卓上无法执行FlatList的滚动
参考链接:https://cloud.tencent.com/developer/article/1093733使用PanResponder来解决,写成函数组件如下:const panResponder = useRef( PanResponder.create({ onStartShouldSetPanResponder: (evt, gestureState) => (console.warn('wrap start responder')),原创 2021-08-19 17:46:51 · 1395 阅读 · 0 评论 -
[RN]使用react-native-push-notification 和 Firebase实现APP推送
react native firebase文档 - 安装和配置生命周期流:注册设备以接收来自 FCM 的消息。客户端应用的实例注册以接收消息,并获取唯一标识应用实例的注册令牌。发送和接收下行消息。发送消息。应用服务器向客户端应用发送消息:消息会在通知编辑器或受信任的环境中编写,并且消息请求会被发送到 FCM后端。FCM 后端接收消息请求,生成消息 ID 和其他元数据,并将其发送到平台特定的传输层。当设备在线时,系统会通过平台特定的传输层将消息发送到设备。在设备上,客户端应用会接收到消原创 2021-08-19 15:49:38 · 2230 阅读 · 0 评论 -
[RN]webview在android上进行页面跳转时发生崩溃
问题描述:项目里需要嵌入YouTube视频,所以用到了react-native-youtube-iframe。然后页面在android上进行页面跳转时偶尔会出现闪退,因为页面里也用到了webview,所以一开始没发现react-native-youtube-iframe也用到了webview…总结: 在页面跳转时,react-navigation 会为整个屏幕(包括 webview,并且仅在 android 中)的不透明度设置动画并迅速使其崩溃。解决方法:方法1.设置webview的不透明度<原创 2021-07-23 12:04:02 · 1211 阅读 · 1 评论 -
使用og协议分享web页面到WhatsApp
知乎: 什么是 Open Graph 标签?不懂你还做什么社交营销优化?!往要分享的链接插入标签:APP端: let jsStr = `<meta property="og:title" content="${title}"> <meta property="og:type" content="website"> <meta property="og:url" content="${shareUrl}" /&原创 2021-06-17 17:38:39 · 1002 阅读 · 0 评论 -
[RN] 实现底部弹出框/中间弹框
https://www.jianshu.com/p/14087afc21ed原创 2021-01-21 14:17:48 · 1156 阅读 · 0 评论 -
[RN] 使用PanResponder,出现“Cannot read property ‘panHandlers’ of undefined”
原因: 官网上给的例子是在componentWillMount里中定义panResponder函数,而componentWillMount已经废弃了,在componentDidMount中定义又不起作用componentWillMount: function() { this._panResponder = PanResponder.create({ // 要求成为响应者: onStartShouldSetPanResponder: (evt, gestureState)原创 2020-11-17 16:20:02 · 418 阅读 · 0 评论 -
RN与web view的通信
RN与web view之间的通信只能传递字符串类型流程:web端向APP端请求数据this.ReactNativeWebView = window.ReactNativeWebView;let result = await info(this.ReactNativeWebView)......// info方法info(_this){ _this.postMessage(JSON.stringify( { type: 'info',原创 2020-11-12 11:01:26 · 637 阅读 · 0 评论 -
React Navigation使用
配置导航堆栈import * as React from 'react';import { View, Text } from 'react-native';import { NavigationContainer } from '@react-navigation/native';import { createStackNavigator } from '@react-navigation/stack';const Stack = createStackNavigator(); // crea原创 2020-09-11 11:26:31 · 300 阅读 · 0 评论 -
[RN]用webview展示Vue单页面应用,跳转页面时,安卓不触发onNavigationStateChange方法
需求:在APP中使用WebView组件展示H5页面,在APP上自定义一个头部回退组件,点击返回按钮,如果H5页面有跳转则返回H5页面的上一页,如果没有跳转则退出当前的APP页面。原本的想法:通过WebView的onNavigationStateChange()方法监听H5页面的跳转,根据此时的canGoBack参数判断进行后续操作。<WebView source={{uri: url}} onNavigationStateChange={navState => { th原创 2020-09-10 15:44:18 · 2956 阅读 · 3 评论 -
总结ref的用法
ref通常被用来获取DOM元素或组件实例string类型的ref<input type='text' ref='input' />......console.log(this.$refs.input) // <input type='text' />$refs 是所有注册过的ref的一个集合在react中,一般使用function类型的ref,上面的这种string类型的ref将会被废弃,因为它无法直接获取this的指向,并且当使用render回调函数的开发模式,原创 2020-09-07 15:04:15 · 3621 阅读 · 0 评论 -
[RN] 传参
父子组件之间传参注意:子组件得到的props的参数不能更改// 父组件export class ComponentA extends React.Component { constructor(props) { super(props); this.state = { num: 1} } onChangeText = value => { this.setState({ num: value }) }原创 2020-08-25 18:03:14 · 437 阅读 · 0 评论 -
[RN] 图片加载
本地图片 <Image source={require('url')} />网络图片 <Image source={{uri: 'url'}} style={{width: , height: }} />原创 2020-08-25 17:40:28 · 730 阅读 · 0 评论 -
[RN]打开website
在浏览器打开链接import {Linking} from 'react-native'......if(Linking.canOpenURL(url)){ Linking.openURL(url)}在APP里打开链接Navigation.openURL(url)Linking提供了一个通用的接口来与预期和传出的App链接进行交互。每个链接(URL)都有一个URL方案,某些网站以https://或为前缀,http://并且http是URL方案。我们简称为“方案”。内置UR.原创 2020-08-25 17:36:11 · 606 阅读 · 0 评论