Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all 17139 articles
Browse latest View live
↧

React Native iOS Unrecognized font family 'Material Design Icons'

$
0
0

I am building a mobile app with react native. The current app works fine on Android, but crashes on iOS.This is the error that gives:

enter image description here

These are the dependencies that I am using:

"dependencies": {"@react-native-community/datetimepicker": "^3.5.2","react": "17.0.1","react-native": "0.64.2","react-native-elements": "^3.4.1","react-native-paper": "^4.9.2","react-native-safe-area-context": "^3.2.0","react-native-vector-icons": "^8.1.0"  },

After some research, the community suggests to link some dependencies manually. Therefore, I linked @react-native-community/datetimepicker, react-native-safe-area-context, react-native-vector-icons. But they produced the following error:

enter image description here

Because I am using RN >= 0.60. So I unlinked them, then the Unrecognized font family Material Design Icons still persists. I did rebuild my app several times with "npx pod-install", but no success. What should I do to get rid of the error and load Material Design Icons properly?

↧

How to blur text in React Native

$
0
0

The question is simple. I have a View with a Text component in it. I just want this text to be blurred initially.The only solution I saw to blur something in React Native is for an Image via this "react-native-blur".

How can we blur a Text component in React Native?

Info: I just want to make an app where the user does not see the answer directly (via blurring).

↧
↧

Multiple commands produce PrivacyInfo.xcprivacy

$
0
0

I am trying to build my app for iOS (using react-native), and I keep getting the error Multiple commands produce PrivacyInfo.xcprivacy.

I know where the error comes from, it's related to the fact that the Toast Pod has an PrivacyInfo.xcprivacy file:

Toast Pod

But I also have one for my app, because otherwise Apple won't accept my app starting 1st of May 2024.

They are colliding, because the files are named the same, but Apple's guidelines are strict in that sense, the file must be named this way, so I cannot rename mine.

My temporary solution has been to delete the Toast privacy file (not just removing the reference, deleting it), but I feel there has to be an actual solution for this (like a way to merge both files).

Has anyone encountered a similar problem?

Thanks

↧

'React/RCTBridgeDelegate.h' file not found - React Native

$
0
0

I am new to react native and have been creating a new app. I tried to update my project from react native 0.60 to 0.63. When doing this I had to create a new project file in order to update my cocoapods. After doing this I tired to run my app on an iOS emulator but am given an error.

When opening my project within Xcode I am given the following error.

error

I am not sure if this has to do with my pods or not. After doing some research online I am unable to find the answer to this problem.

Here is my profile file.

# Uncomment the next line to define a global platform for your project platform :ios, '10.0'target 'Example' do  # Comment the next line if you don't want to use dynamic frameworks  use_frameworks!  # Pods for Example  target 'ExampleTests' do    inherit! :search_paths    # Pods for testing  endendtarget 'Example-tvOS' do  # Comment the next line if you don't want to use dynamic frameworks  use_frameworks!  # Pods for Example-tvOS  target 'Example-tvOSTests' do    inherit! :search_paths    # Pods for testing  end  target 'OneSignalNotificationServiceExtension' do    # Comment the next line if you don't want to use dynamic frameworks    use_frameworks!    # Pods for OneSignalNotificationServiceExtension    pod 'OneSignal', '>= 2.9.3', '< 3.0'  endend
↧

ERROR [ERROR] 20:56.724 AWSPinpointProvider - updateEndpoint failed [TypeError: Cannot read property 'byteLength' of undefined]

$
0
0

I am new to Amplify, but have successfully created this set up via the CLI for ReactNative:

│ Category      │ Resource name  │ Operation │ Provider plugin   ││ Auth          │ userPoolGroups │ No Change │ awscloudformation ││ Auth          │ Rent           │ No Change │ awscloudformation ││ Analytics     │ RentAppIOS     │ No Change │ awscloudformation ││ Notifications │ RentAppIOS     │ No Change ││

Right now I am trying to get push notifications to work for IOS using PinPoint. All the permissions look to be OK but I am running into the an error when trying to run updateEndpoint on Analytics which is supposed to create a new endpoint in PinPoint. This is the error:

AWSPinpointProvider - updateEndpoint failed [TypeError: Cannot read property 'byteLength' of undefined]

This is the function which is called after user has logged in and is causing the error:

const registerForPushNotifications = async () => {    const { attributes: {sub} } = await Auth.currentUserInfo();    if (sub) {      DeviceInfo.getDeviceToken().then((deviceToken) => {          Analytics.updateEndpoint({              address: deviceToken,              optOut: "NONE",              userId: sub,              channelType: "APNS",        }).then(() => {           console.log("Endpoint created");        }).catch((error) => {           console.log('Error updating endpoint', error);        });      });    }  }

The variables sub and deviceToken have values as expected. Here is the config setup when the app is initiated:

Amplify.configure({  ...awsconfig,  Analytics: {    disabled: false,  },  Predictions: {    provider: AmazonAIPredictionsProvider,    region: awsconfig.aws_mobile_analytics_app_region,  },});Analytics.configure({  ...awsconfig,  AWSPinpoint: {    region: awsconfig.aws_mobile_analytics_app_region,  },});PushNotification.configure({  ...awsconfig,  onNotification: function (notification) {    console.log('NOTIFICATION:', notification);    Alert.alert(      notification.title,      notification.body,      [{ text: 'OK' }],      { cancelable: false }    );    notification.finish("backgroundFetchResultNewData");  },  permissions: {    alert: true,    badge: true,    sound: true,  },  popInitialNotification: true,  requestPermissions: true,});

Here is the aws-exports.js file example which is being imported as awsconfig:

const awsmobile = {    aws_project_region: "eu-west-2",    aws_cognito_identity_pool_id: "eu-west-2:xxxxxxxx-c514-4431-91c0-xxxxxxxx",    aws_cognito_region: "eu-west-2",    aws_user_pools_id: "eu-west-2_xxxxxxxx",    aws_user_pools_web_client_id: "xxxxxxxxxxxxxxxxxxx2m5pmf",    aws_pinpoint_id: "b6846xxxxxxxxxxxxxxxxxxxxxxxxxxx",    aws_mobile_analytics_app_id: "xxxxxxxxxxete",    aws_mobile_analytics_app_region: "eu-west-2",     aws_mobile_analytics_app_title: "Rent",     aws_mobile_analytics_auto_session_record: true,    aws_mobile_analytics_disabled: false};export default awsmobile;

I really hope someone can see what is wrong, I've spent days looking over this and available documentation online is not highlighting anything. I appreciate any feedback :)

↧
↧

How to Implement Resizable, Movable, and Removable Dragable Rectangle in React Native for Both iOS and Web?

$
0
0

I am looking to implement a feature in React Native (which supports both iOS and web) that allows users to draw a resizable rectangle by dragging. After drawing, users should be able to resize, move, or delete the rectangle, and the coordinates of the rectangle should be recorded.

I found that the react-konva library provides this functionality perfectly (for example: https://konvajs.org/docs/react/Transformer.html), but it is only available for web React and is not suitable for React Native. Is there something similar available for React Native?

So far, I have tried using react-native-gesture-handler, but the results are not even close to what react-konva offers

import React, { useState } from 'react';import { View, StyleSheet, TouchableOpacity, Text, Platform } from 'react-native';import Svg, { Circle, Polygon } from 'react-native-svg';import { GestureEvent, PanGestureHandler, PanGestureHandlerEventPayload } from 'react-native-gesture-handler';const DrawRectangle = () => {  const [start, setStart] = useState(null);  const [end, setEnd] = useState({ x: 0, y: 0 });  const [dimensions, setDimensions] = useState({ w: 0, h: 0 });  const onPress = (event) => {    const { x, y, translationX, translationY } = event.nativeEvent;    if (!start) setStart({ x: y, y: x });    setDimensions({ w: translationX, h: translationY });  };  const onEnd = () => {    if (!start) return;    setEnd(start);    setStart(null);  };  return (<View style={{ flex: 1 }}><PanGestureHandler onGestureEvent={onPress} onEnded={onEnd}><View style={{ width: '100%', height: '100%', backgroundColor: 'red' }}><View            style={{              position: 'absolute',              backgroundColor: 'blue',              top: start?.x ?? end?.x,              left: start?.y ?? end?.y,              width: dimensions?.w ?? 0,              height: dimensions?.h ?? 0            }}          /></View></PanGestureHandler></View>  );};export default DrawRectangle;

Here's a brief outline of my requirements:

Draw a rectangle by dragging.Resize the rectangle after it is drawn.Move the rectangle to a different location.Delete the rectangle if needed.Record the coordinates of the rectangle.Could anyone suggest a suitable library or approach to achieve this in React Native for both iOS and web?

Any help or guidance would be greatly appreciated!

↧

iOS App reward referrals using Expo and Firebase

$
0
0

I am working on an iOS app using Expo (React Native) and Firebase. We want to offer referral rewards to users who get others to download the app. Right now, we simply have a "Who told you about us" section when creating an account, but we'd like to be able to send out a referral code with the invite and track whether that user downloads the app, as described here. Unfortunately, I can't seem to find how to do this with Expo specifically. I'd love some help with this :)

↧

How to prevent layout from overlapping with iOS status bar

$
0
0

I am working on tutorial for React Native navigation. I found out that all layout starts loading from top of screen instead of below of the status bar. This causes most layouts to overlap with the status bar. I can fix this by adding a padding to the view when loading them. Is this the actual way to do it? I don' think manually adding padding is an actual way to solve it. Is there a more elegant way to fix this?

import React, { Component } from 'react';import { View, Text, Navigator } from 'react-native';export default class MyScene extends Component {    static get defaultProps() {            return {                    title : 'MyScene'            };      }       render() {            return (<View style={{padding: 20}}> //padding to prevent overlap<Text>Hi! My name is {this.props.title}.</Text></View>             )       }    }

Below shows the screenshots before and after the padding is added.enter image description here

↧

React Native Swipe to delete functionality in a section list using RNGH Issue

$
0
0

I have a sectionlist with notifications and would like to have each row in a section be capable of swiping to delete. I have implemented the swipe to delete functionality but the issue I am facing now is that everytime I scroll down the sectionlist and a pan gesture is active on one of the rows, I cannot scrolling becomes disabled. Can anyone with experience guide me on this ? Happy to learn:)

import { View , Text, StyleSheet, Modal, Button, TouchableOpacity,SectionList} from "react-native";import {useSelector} from "react-redux";import { NotificationLikeStack } from "../../components/Stacks/NotificationStacks/NotificationLikeStack";  import { NotificationCommentStack } from "../../components/Stacks/NotificationStacks/NotificationCommentStack"; import { fetchDocs, doDocsExist,deleteDocsFromDB,addDocsToDB, addDocToDB, addDocsWithDifferenDataToDB, fetchData } from "../../firebase/firestoreDB";import { bottomPopUpMessage } from "../../constants";import HorizontalScrollButton from "../../components/HorizontalScrollButton/HorizontalScrollButton";import { Divider } from "@ui-kitten/components";import { NotificationFollowersStack } from "../../components/Stacks/NotificationStacks/NotificationFollowersStack";import { isToday } from "../../constants";import { set } from "firebase/database";import { handleSendPushNotification } from "../../constants";import uuid from "react-native-uuid";import * as Linking from 'expo-linking';import { FlatList, ScrollView,  } from "react-native-gesture-handler";const NotifcationScreen = ({navigation, route}) => {     const [notifications, setNotifications] = useState([])    const [filteredNotifications, setFilteredNotifications] = useState([notifications])    const buttons = ['All', 'Likes', 'Comments', 'Followers']    const [selectedButton, setSelectedButton] = useState(null)    const userinfo = useSelector((state) => state.auth.userInfo)    const [email, setEmail] = useState(userinfo?.email)    const [filterButtonPressed, setFilterButtonPressed] = useState(false)    const [usersBeingFollowed, setUsersBeingFollowed] = useState([])    const [hasPressedFollowButton, setHasPressedFollowButton] = useState(false)    const LinkingUrl = Linking.useURL();    const sectionListRef = useRef(null)    const [isScrollEnabled, setIsScrollEnabled] = useState(true)    // const section = notifications ? [    //     {    //         title: 'Likes',    //         data: notifications.filter((notification) => notification.type === 'like')    //     },    //     {    //         title: 'Comments',    //         data: notifications.filter((notification) => notification.type === 'comment')    //     },    //     {    //         title: 'Followers',    //         data: notifications.filter((notification) => notification.type === 'follow')    //     }    // ] : []    const section = notifications ? [      {        title: 'Today',        data: !filterButtonPressed ? notifications.filter(          (notification) =>  isToday(notification.createdAt)        ) : filteredNotifications.filter( (notification) => isToday(notification.createdAt)),      },      {        title: 'Older',        data: !filterButtonPressed ? notifications.filter(          (notification) => !isToday(notification.createdAt)        ) : filteredNotifications.filter( (notification) => !isToday(notification.createdAt)),      }    ]  : [];    const fetchNotifications = async () => {        const path = `users/${email}/notifications`        const response = await fetchDocs(path)        if (response.success){            setNotifications(response.fetchedDocs.reverse())        }        else{            bottomPopUpMessage(response)        }    }    const renderItem = ({ item }) => {          if (item.type === 'like'){            return (<NotificationLikeStack notification={item} onPressed={() => {                    navigation.navigate("HomeScreen", item.params)                }}/>            )        }        else if (item.type === 'comment'){            return (                item.params.type === "polls" ? <NotificationCommentStack notification={item} onPressed={() => navigation.navigate("HomeScreen",item.params) }/>                 : <NotificationLikeStack setIsScrollEnabled={setIsScrollEnabled} notification={item} onPressed={() => {                        navigation.navigate("HomeScreen", item.params)                }}/>            )        }        else if (item.type === 'follow'){            const isFollowing = usersBeingFollowed.includes(item.followID)            return (<NotificationFollowersStack                 notification={item}                 isFollowing={isFollowing}                onPressFollowButton={() => {                    onPressFollow(item, isFollowing)                    }                }                onPressed={async () => {                    const params = await redirectedProfileHandler(item.followID)                    navigation.navigate("Profile", params)                }}                />            )        }    }    useEffect(() => {        fetchNotifications()    }, [])    //console.log(notifications)    return (<View style={styles.container}><View style={{marginHorizontal: 20}}><HorizontalScrollButton                    buttons={buttons}                    onButtonPress={handleButtonPress}                    selectedButton={selectedButton}                    setSelectedButton={setSelectedButton}                /></View><View style={{backgroundColor:'green'}}><SectionList            SectionSeparatorComponent={renderSectionSeparator}            stickySectionHeadersEnabled={false}            sections={section}            keyExtractor={(item, index) => item + index}            renderItem={({item}) => renderItem({item})}            renderSectionHeader={({section: {title, data}}) => {                if ( data.length === 0) {                    return null; // Don't render the header if there are no likes                  }                  return <Text style={styles.header}>{title}</Text>;             }}            scrollEnabled={isScrollEnabled}            ref={sectionListRef}            style={{}}            />  </View></View>    )}const styles = StyleSheet.create({    container: {        flex: 1,        backgroundColor: 'white',        //marginHorizontal: 0        //marginHorizontal: 16,    },    header: {        fontSize: 20,        fontWeight: 'bold',        //backgroundColor: '#fff',        margin:20,      },})export default NotifcationScreen;import React from 'react';import { View, Text, StyleSheet, TouchableOpacity} from 'react-native';import { Image } from 'expo-image';import { ImageDict } from '../../../constants';import { CustomButtons } from '../../buttons/Buttons';import { handleTimePosted } from '../../../constants';import { Ionicons } from '@expo/vector-icons';import { Gesture, GestureDetector } from 'react-native-gesture-handler';import Animated,{ runOnJS, useAnimatedStyle, withSpring, useSharedValue} from 'react-native-reanimated';export const NotificationFollowersStack = ({imageExtraStyle, notification, isFollowing, onPressFollowButton, onPressed }) => {    const profilePic = notification.profilePic ? notification.profilePic : ImageDict.user    const translateX = useSharedValue(0);    const animatedStyles = useAnimatedStyle(() => ({        transform: [{ translateX: withSpring(translateX.value) }],    }));    const gesture = Gesture.Pan().        onBegin(() => {            console.log(translateX.value);        }).        onChange((event) => {               if (event.translationX < 0){                translateX.value = -50;            }            if (event.translationX > 0){                translateX.value = 0;            }            //translateX.value = event.translationX;        }).        onFinalize(() => {             console.log(translateX.value);            //translateX.value = withSpring(10);        })        const onPressOptionsClose = () => {            set        }        return (<View style={{flex:1}}><GestureDetector             gesture={gesture}><Animated.View style={[styles.container, animatedStyles]} onPress={onPressed}><Image                    style={[styles.profileImageStyles, imageExtraStyle]}                    source={profilePic}                    /><View style={styles.textStackContainer}><Text><Text style={styles.userhandle}>{notification.userhandle}</Text> {notification.title} </Text><Text style={styles.timeStyle}>{handleTimePosted(notification.createdAt)}</Text></View><View style={styles.innerContainer}>                        {!isFollowing ? <CustomButtons                         name={"follow-long"}                         extraStyle={styles.followButtonStyle}                         onPress={onPressFollowButton}/> :<CustomButtons                             name={"unfollow-long"}                             extraStyle={styles.followButtonStyle}                             onPress={onPressFollowButton}/>                            }</View></Animated.View></GestureDetector><View style={styles.deleteStyles}><View style={{position:"absolute", right:5}}><Ionicons name="trash-sharp" size={24} color="black" /></View><View style={{backgroundColor:"white", position:"absolute", left:0, top:0, bottom:0, height:'100%', width:"50%"}}/></View></View>        )}const styles = StyleSheet.create({    container: {        flexDirection: 'row',        //alignItems:'center',        justifyContent:'space-between',        backgroundColor: 'white',        width: '100%',        padding: 20,        zIndex: 1,        //margin: 20,    },    textStackContainer: {        justifyContent: 'center',        //backgroundColor: 'yellow',        flex: 1,        paddingLeft: 10,        paddingRight: 10,        //padding: 10        //alignItems: 'center',    },    profileImageStyles: {        height:50,        width:50,        borderRadius:25,    },    deleteStyles:{        position: 'absolute',        right: 0,        left: 0,        top: 0,        bottom: 0,        justifyContent: 'center',        alignItems: 'flex-start',        //bottom: 10,        zIndex: 0,        justifyContent:'center',        backgroundColor:'red',        paddingRight: 0,    },    imageStyles: {        height:50,        width:50,        borderRadius:5,    },    userhandle: {        fontWeight: 'bold',    },    timeStyle: {        color:'grey',        marginTop: 5,        //marginLeft:10    },    followButtonStyle: {        backgroundColor: '#FF6657',        width: 80,        height: 40,        borderRadius: 10,    },})```
↧
↧

How to resolve Invalid 'expo-dev-launcher.podspec' file: undefined method 'add_dependency' for Pod:Module in React Native project

$
0
0

I am getting the error

Invalid Podfile file:Invalid expo-dev-launcher.podspec file: undefined method `add_dependency' for Pod:Module.

when I try to do pod install. The error is in the file [MyAppProjectName]/node_modules/expo-dev-launcher/expo-dev-launcher.podspec

I have tried installing expo-dev-launcher to see if that would provide the method that this file is looking for and a number of other things. I have also tried commenting out that line, but then it ran into the same error in another file where the file was using add_dependency(), but the error said again that that method was undefined.

Maybe I am missing a dependency or one of the dependencies should be a different version?

Ultimately, I am trying to create a local development build of my app.

Here are my dependencies in my package.json file:

"dependencies": {"@babel/preset-env": "^7.24.5","@babel/runtime": "^7.24.5","@expo/config-plugins": "^8.0.4","@expo/prebuild-config": "^7.0.4","@react-native-masked-view/masked-view": "0.3.1","@react-navigation/bottom-tabs": "^6.5.11","@react-navigation/native": "^6.1.9","@react-navigation/native-stack": "^6.9.17","@react-navigation/stack": "^6.3.20","apisauce": "^3.0.1","core-js": "^3.35.1","expo": "^49.0.0","expo-app-loading": "^2.1.1","expo-constants": "~16.0.1","expo-dev-client": "~4.0.14","expo-dev-launcher": "^4.0.15","expo-dev-menu": "^5.0.14","expo-font": "~12.0.5","expo-modules-autolinking": "^1.11.1","expo-secure-store": "~13.0.1","expo-splash-screen": "~0.27.4","expo-status-bar": "~1.12.1","firebase": "^10.7.1","formik": "^2.4.5","jwt-decode": "^4.0.0","react": "18.2.0","react-native": "^0.72.10","react-native-device-info": "^10.12.0","react-native-flipper": "^0.212.0","react-native-gesture-handler": "~2.16.1","react-native-google-mobile-ads": "^13.3.0","react-native-reanimated": "~3.10.1","react-native-safe-area-context": "4.10.1","react-native-screens": "3.31.1","yup": "^1.3.3"  }
↧

OS pod install error. Module glog cannot be installed

$
0
0

I'am trying to upgrade "react-native" from "0.50.4" to "0.55".

When I run pod install, i receive an error

checking for a BSD-compatible install... /usr/local/bin/ginstall -cchecking whether build environment is sane... yeschecking for arm-apple-darwin-strip... nochecking for strip... stripchecking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -pchecking for gawk... nochecking for mawk... nochecking for nawk... nochecking for awk... awkchecking whether make sets $(MAKE)... nochecking whether make supports nested variables... nochecking for arm-apple-darwin-gcc...  -arch armv7 -isysroot checking whether the C compiler works... noxcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrunxcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun/Users/MacBook/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b/missing: Unknown `--is-lightweight' optionTry `/Users/MacBook/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b/missing --help' for more informationconfigure: WARNING: 'missing' script is too old or missingconfigure: error: in `/Users/MacBook/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b':configure: error: C compiler cannot create executablesSee `config.log' for more details[!] Automatically assigning platform `ios` with version `8.0` on target `quanta_react` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

I am a beginner in react-native and I can not make a pod install in my iOS project.Thank you in advance.

↧

Cannot discover a Tuya powered bluetooth device using Tuya Smart Life app SDK in a React Native environment

$
0
0

I am having some trouble using Tuya Smart Life app SDK in my React Native application.

I am using this library to bridge between Tuya's native SDK and React Native.

Using the SDK I successfully created a user, a home and then started the bluetooth scan,in the logs i can see that is discovers my device.After following Tuya Docs i see the discovered device should be returned from the "didDiscoveryDeviceWithDeviceInfo" but it doesn't happen for me.

Not sure if its connected but in the logs i see this:

[ThingRequest] request: domain = a1-us.iotbing.com, url = https://a1-us.iotbing.com/api.json, api =smartlife.m.device.bind.status.get, commonParams = {"lang" : "en","bizData" : "{\"nd\":1,\"customDomainSupport\":\"1\"}","deviceId" : "229A6B7E-D000-46B5-96F7-8FA1D39246F2","et" : "0.0.2","osSystem" : "17.4.1","bundleId" : "com.loopump.app","time" : "1715584371","lon" : 0,"channel" : "sdk","nd" : 1,"appVersion" : "1.0.0","ttid" : "appstore_d","os" : "IOS","v" : "1.1","sid" :"az171557r6264723dJPjtCF38dfad8b6ed4cd012febe985129302799","sign" :"e48995f2513ccefae9936cfe387f3cb100606a3e22bd7a02f07aa6c424dd6f32","platform" : "iPhone 13","requestId" : "326662BA-85AC-4C63-A94B-7D7E77D70E57","sdkVersion" : "5.2.0","timeZoneId" : "Asia\/Manila","lat" : 0,"clientId" : "nwvrfnnvnd5kxvrss55x","deviceCoreVersion" : "5.7.0","a" : "smartlife.m.device.bind.status.get","cp" : "gzip"}, businessParams = {"encryptValue" : "4A536DA0ECEBAEE5",<...>[ThingRequest] response: api = smartlife.m.device.bind.status.get,data = {"success" : false,"errorCode" : "PERMISSION_DENIED","status" : "error","errorMsg" : "No access","t" : 1715584370720}

The device id here is not of the bluetooth device i am trying to pair but its the actual Iphone that is scanning for devices.

This is the Objective-C code that starts the scan and should return the discovered device:

static TuyaBLERNScannerModule * scannerInstance = nil;@interface TuyaBLERNScannerModule()<ThingSmartBLEManagerDelegate>@property(copy, nonatomic) RCTPromiseResolveBlock promiseResolveBlock;@property(copy, nonatomic) RCTPromiseRejectBlock promiseRejectBlock;@end@implementation TuyaBLERNScannerModuleRCT_EXPORT_MODULE(TuyaBLEScannerModule)RCT_EXPORT_METHOD(startBluetoothScan:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter) {  if (scannerInstance == nil) {    scannerInstance = [TuyaBLERNScannerModule new];  }  NSLog(@"DEBUG: startBluetoothScan");  [ThingSmartBLEManager sharedInstance].delegate = scannerInstance;  scannerInstance.promiseResolveBlock = resolver;  scannerInstance.promiseRejectBlock = rejecter;  [[ThingSmartBLEManager sharedInstance] startListening:YES];}- (void)didDiscoveryDeviceWithDeviceInfo:(ThingBLEAdvModel *)deviceInfo {  // print device info  NSLog(@"DEBUG: %@", [deviceInfo yy_modelToJSONObject]);  if (scannerInstance.promiseResolveBlock) {    self.promiseResolveBlock([deviceInfo yy_modelToJSONObject]);  }}@end

It never reaches the "didDiscoveryDeviceWithDeviceInfo", the logs never logs.

↧

How to start building queue management app [closed]

$
0
0

I want to develop a queue management app for mobile. it should be supported by iOS and Android too, the app should include admin side for the customer and client site for the customer's client.I'm familiar with JS and React. Should i develop the app in React-Native or something else.

What will be better to start with?

↧
↧

CocoaPods could not find compatible versions for pod "StripePayments"

$
0
0

I have created a react-native project having following dependencies:"react": "18.2.0","react-native": "0.73.1",

Now I am trying Stripe Payment Integration in this project. For this I have installed the node package :"@stripe/stripe-react-native": "^0.37.3",

But when I am trying to do "pod install" I am getting error :

[!] CocoaPods could not find compatible versions for pod "StripePayments": In Podfile: stripe-react-native (from ../node_modules/@stripe/stripe-react-native`) was resolved to 0.37.3, which depends onStripePayments (~> 23.27.0)

None of your spec sources contain a spec satisfying the dependency: StripePayments (~> 23.27.0).

You have either:

out-of-date source repos which you can update with pod repo update or with pod install --repo-update.mistyped the name or version.not added the source repo that hosts the Podspec to your Podfile.`System details =>system : macOS Sonoma version 14.4.1simulator : iPhone 15 Pro Max - iOS 17.2

cocoapods =>gem which cocoapods/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods.rb

Any ideas??Please assist me here..

I tried some solutions like :

But none of them worked for me.

PLEASE HELP ME INSTALL STRIPE SDK.

↧

StripeProvider + Invariant Violation: `new NativeEventEmitter()` requires a non-null argument., js engine: hermes

$
0
0

when I am trying to integrate stripe in react-native component I am getting following error :

Invariant Violation: new NativeEventEmitter() requires a non-null argument., js engine: hermesTypeError: Cannot read property 'StripeProvider' of undefined

I have just imported StripeProvider in my component like this =>

import {StripeProvider} from '@stripe/stripe-react-native';

After which I wrapped my component like this and nothing else.

return (<StripeProvider      publishableKey={STRIPE_PUBLISHABLE_KEY}      merchantIdentifier={STRIPE_MERCHANT_ID}><SafeAreaView        style={{flex: 1, backgroundColor: COLORS.DEFAULT_APP.PRIMARY}}><View style={styles.mainContainer}><Text style={styles.titleMessage}>{title}</Text><Text style={styles.subtitleMessage}>{subtitle}</Text><NeuMorph            size={window.width * 0.8}            style={{              marginTop: 80,              height: 80,              borderRadius: 12,              flexDirection: 'row',            }}><View style={{flex: 2}}><Text style={styles.message}>{message}</Text><Text style={styles.message}>{subMessage}</Text></View><View style={{flex: 1}}><Text style={styles.price}>{currency +''+ price}</Text></View></NeuMorph><View style={{margin: 50}}><MaterialIcons              name={materialIcon}              size={80}              color={COLORS.DEFAULT_APP.TERTIARY}            /></View>          {note && <Text style={styles.noteMsg}>{note}</Text>}<View style={styles.bottomContainer}><NeuMorphButton              buttonSize={300}              title={buttonTitle}              onPressFunction={subscribe}              buttonStyle={{                borderRadius: 24,                height: 50,                margin: 5,              }}            /></View></View></SafeAreaView></StripeProvider>  );

I tried this but it didn't worked for me

text

↧

Running React Native app on iOS Simulator hangs while building during ComputeTargetDependencyGraph

$
0
0

I have a React Native app that I'm trying to run on the iOS Simulator on my laptop. To launch this, I do npm start from my project directory, which shows the nice Metro icon then

r - reload the appd - open developer menui - run on iOSa - run on Android

Before, when I hit i, it would work the majority of the time but sometimes get hung up on a particular step. After some recent changes and installing a new library (and successfully doing npx pod-install), it's now getting hung up on the same step every time.

The step is: after hitting i, I get this:

info Opening the app on iOS...info Found Xcode workspace "notoapprn.xcworkspace"info Found booted iPhone 14info Launching iPhone 14info Building (using "xcodebuild -workspace notoapprn.xcworkspace -configuration Debug -scheme notoapprn -destination id=5655375F-31B9-47EC-9DD1-196F4CB8C86D")info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctorCommand line invocation:    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace notoapprn.xcworkspace -configuration Debug -scheme notoapprn -destination id=5655375F-31B9-47EC-9DD1-196F4CB8C86DUser defaults from command line:    IDEPackageSupportUseBuiltinSCM = YESPrepare packagesComputeTargetDependencyGraphnote: Building targets in dependency ordernote: Target dependency graph (68 targets)Target 'notoapprn' in project 'notoapprn'➜ Explicit dependency on target 'NotoMeShare' in project 'notoapprn'➜ Implicit dependency on target 'Pods-notoapprn' in project 'Pods' via file 'libPods-notoapprn.a' in build phase 'Link Binary'➜ Implicit dependency on target 'CocoaAsyncSocket' in project 'Pods' via options '-lCocoaAsyncSocket' in build setting 'OTHER_LDFLAGS'➜ Implicit dependency on target 'DoubleConversion' in project 'Pods' via options '-lDoubleConversion' in build setting 'OTHER_LDFLAGS'...

and many more lines noting Targets and their explicit / implicit dependencies. However, when it gets hung up, it'll literally print only part of a line, then nothing continues to happen, eg:

➜ Implicit dependency on target 'RCT-Folly' in project 'Pods' via options '-lRCT-Folly' in build setting 'OTHER_LDFLAGS'➜ Implicit dependency on target 'RCTTypeSafety' in project 'Pods' via options '-lRCTTypeSafety' in build setting 'OTHER_LDFLAGS'➜ Implicit dependency on target 'RNShareMenu' in project 'Pods' via options '-lRNShareMenu' in build setting 'OTHER_LDFLAGS'➜ Implicit dependency on target 'React-Codegen' in project 'Pods' via op

The line is seemingly broken partway through.

More mysteriously, if I cancel this command and try running it all again, it'll get hung up again but possibly in a different spot in the list of targets/dependencies.

Any tips on debugging this?

↧

Upgrading iOS Target Platform to meet minimal Pod version requirements

$
0
0

I have an iOS project that I am building in XCode/Cocoa Pods. When I run the pod install commands I get a lot of warnings for many (if not all) of my pods:

"[!] The platform of the target myapp (iOS 11.0) may not be compatible with <the-name-and-version-of-the-pod-here> which has a minimum requirement of iOS 12.4."

What setting in Xcode or my Podfile can I change to "upgrade" my "target platform" so that it meets the minimal version requirement of all these pods (which across the board are "12.4")?

Under Target > Build Settings/General tabs in Xcode, everything is currently set to 13.0, so I'm not sure why Cocoa Pods is thinking I am targeting version 11 of anything.

↧
↧

SSLHandshakeException during Gradle Build for React Native App on Windows

$
0
0

I am encountering an SSLHandshakeException while trying to build and install a React Native app using Gradle on my Windows machine. The error occurs when Gradle attempts to resolve dependencies. Here are the details of the error:

`* What went wrong:A problem occurred configuring root project 'app_name'.

Could not determine the dependencies of task ':gradle-plugin:compileKotlin'.javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

  • 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 12serror Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'app_name'. > Could not determine the dependencies of task ':gradle-plugin:compileKotlin'. > javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target * 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 12s.`

I verified that my internet connection is stable, Executed the build with the --info flag to obtain detailed logs and ran gradlew cleanBuildCache to clear the Gradle cache but nothing seems to work. Kindly Help.

↧

React Native - EMDK error: Could not find method compileOnly() for arguments [com.symbol:emdk:7.0.0.]

$
0
0

Does anyone here tried the React Native Zebra Scanner?

can someone please help me? How to install the emdk?

When I tried the package I got this error.

* What went wrong:Could not determine the dependencies of task ':app:processDebugResources'.> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.> Could not find com.symbol:emdk:7.0.0.     Searched in the following locations:       - https://oss.sonatype.org/content/repositories/snapshots/com/symbol/emdk/7.0.0/emdk-7.0.0.pom       - https://repo.maven.apache.org/maven2/com/symbol/emdk/7.0.0/emdk-7.0.0.pom       - file:/Users/usr/Desktop/barcodetest/node_modules/jsc-android/dist/com/symbol/emdk/7.0.0/emdk-7.0.0.pom       - https://dl.google.com/dl/android/maven2/com/symbol/emdk/7.0.0/emdk-7.0.0.pom       - https://www.jitpack.io/com/symbol/emdk/7.0.0/emdk-7.0.0.pom     Required by:         project :app > project :react-native-zebra-scanner

This is my build.gradle:

buildscript {    ext {        buildToolsVersion = "34.0.0"        minSdkVersion = 23        compileSdkVersion = 34        targetSdkVersion = 34        ndkVersion = "26.1.10909125"        kotlinVersion = "1.9.22"    }    repositories {        google()        mavenCentral()    }    dependencies {        classpath("com.android.tools.build:gradle")        classpath("com.facebook.react:react-native-gradle-plugin")        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")    }    dependencies {      compileOnly('com.symbol:emdk:7.0.0')  }}apply plugin: "com.facebook.react.rootproject"

I also followed this solution but didn't work.

https://developer.zebra.com/forum/25271

↧

ERROR TypeError: Cannot read property 'show' of null, js engine: hermes

$
0
0

I have upgraded my react native app from version 0.71.10 to 0.72.14.But i'm not able to use the react-native-picker-module when i click app crashes with ERROR TypeError: Cannot read property 'show' of null, js engine: hermes.

Note: This issue is only in Android.

react-native-picker-module verison 2.0.4

[Screenshot]

Tried upgrading picker module to latest version but still same issue.It's working fine on iOS.

↧
Viewing all 17139 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>