Questions tagged javascript

Explore the latest questions and answers asked by our top developers. client automatically disconnecting in long Node.js function

I am using to communicate the swift client of my app with the server. Essentially, the client joins a socket connection upon opening the app and a job is instantly added to a Redis queue (it’s a job that takes anywhere from a few seconds to like 15ish seconds). There’s a response from the […]

By nickcoding2
Categorised as javascript, node.js, redis,, swift Tagged , , , ,

iOS Safari Ignores Body Overflow: Hidden when Input Focused

It appears that on iOS 14.5 in Safari (haven’t tested in Chrome), overflow: hidden is ignored if the user is focused in an input field. Now, you can add a touch-action: none to the body element and that works in some situations, but it’s a hack (it doesn’t actually disable scrolling) and that attribute is […]

By Colin
Categorised as css, html, ios, javascript, mobile-safari Tagged , , , ,

Firestore Push Notification "time out" error Notification doesn’t always get sent

I am calling a function from my app that sends a notification out to a specific user on the app. The notification gets sent successfully much of the time but a good amount of times it does not get sent. When it does not get sent I check the logs to see Function execution took […]

By user6520705
Categorised as javascript, swift Tagged ,

HTML number input issues with decimal seperator

I’ve some issues with decimal input on iOS using the numeric keypad. I have the following HTML: $(‘#number’).keyup(function() { $(‘#log’).prepend(‘<p>Input: ‘ + $(this).val() + ‘</p>’); }); <script src=””></script> <input type=”number” inputmode=”decimal” id=”number”> <p> Input as number: <div id=”log”></div> </p> This is working as expected in Chrome browser, Android etc., but on iOS there is some […]

By dhrm
Categorised as html, ios, javascript, jquery Tagged , , ,

Intermittent crashes with audio in react-native

Crashing when audio is played: I am creating an app with several different screens of audio clips. We are testing out the app on iPhone/iPad using Testflight and are getting intermittent crashes when audio clips are played. There seems to be nothing wrong with the audio clips themselves as most of the time they work […]

By kojow7
Categorised as audio, crash, ios, javascript, react-native Tagged , , , ,

How to delete a document in Firestore using cloud functions

I want to check documents as they are created in firestore to ensure there are no swear words contained in a publicly visible field. I would like to be able to delete the post after it has been detected to contain swear words. To do this I am trying to use firebase cloud functions: // […]

In React Native, How Can I Use KeyboardAvoidingView with a Modal in iOS?

I am having trouble getting a KeyboardAvoidingView to work in iOS, specifically when wrapping a Modal in it. Testing in Android, the Modal avoids the keyboard correctly, but in iOS the keyboard covers the Modal. Here is a reproducible example, using an iPhone X as my test device: import React, {useState} from ‘react’; import {StyleSheet, […]

By MoreFoam
Categorised as android, ios, javascript, react-native, reactjs Tagged , , , ,

iOS safari – check if permission granted for device motion

On iOS Safari, we must request permission to access device motion data as follows: if (typeof DeviceMotionEvent.requestPermission === ‘function’) { DeviceMotionEvent.requestPermission() .then(permissionState => { if (permissionState === ‘granted’) { window.addEventListener(‘devicemotion’, () => {}); } }) .catch(console.error) ; } else { // Device is not iOS 13+, no permission requests are neccessary } This code must […]

By David Callanan
Categorised as ios, javascript, web Tagged , ,

Safe area insets (e.g. safe-area-inset-bottom) ignore Safari ‘Aa’ zoom level?

We have the following code adding safe area height to a bottom toolbar so the iOS home bar doesn’t appear over the top of the bottom toolbar icons. /* Extra bottom padding for iPhoneX and iPad Pro Home bar */ @supports (padding: constant(safe-area-inset-bottom)) { .dvFooterContainer1 { –safe-area-inset-bottom: constant(safe-area-inset-bottom); height: calc(var(–safe-area-inset-bottom) + 56px); } } @supports […]

By user1946932
Categorised as css, ios, javascript, safari, webkit Tagged , , , ,

React Native – Clear previous push notifications on receiving local push notification

I’m using react-native-push-notification for scheduling and generating local push notifications in React Native and I’m trying to clear previously received notification on receiving any scheduled notification or auto remove currently received notification after sometime but I can’t find any way to achieve it on iOS. One way is to use timeoutAfter property provided by the […]

1 2

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us