I am developping recordig app with expo. When build and publish this app for web, ios mic is not working. Audio.requestPermissionsAsync() is working well, but Audio.Recording.createAsync() is not working well. Is "expo-av" not available for web browser? Here is the part of code.
import { useState } from 'react';
import { Audio } from 'expo-av';
const [recording, setRecording] = useState();
async function startRecording() {
try {
console.log('Requesting permissions..');
await Audio.requestPermissionsAsync();
await Audio.setAudioModeAsync({
allowsRecordingIOS: true,
playsInSilentModeIOS: true,
});
console.log('Starting recording..');
const { recording } = await Audio.Recording.createAsync( Audio.RecordingOptionsPresets.HIGH_QUALITY
);
setRecording(recording);
console.log('Recording started');
} catch (err) {
console.error('Failed to start recording', err);
}
}
When run npx expo start and simulate with Expo Go, this app worked well. When run netlify deploy (deploy web-build folder to netlify) and simulate with web browser (Edge) on windows, worked well. However, with web browser (Safari) on iphone, mic is not available. The following is console log of safari. Error content is not printed. I'm in a bind. Can someone please advise me on what to do ?
Guthub Repository is this
Related
Hello guys I just started using playwright and JavaScript. I am having a trouble figuring out how to load chrome extension from local folder while opening browser for automation. I want to automate chrome extension but so far the only clue that I have got is to use this code
const { chromium } = require('playwright');
(async () => {
const pathToExtension = require('path').join(__dirname, 'my-extension');
const userDataDir = '/tmp/test-user-data-dir';
const browserContext = await chromium.launchPersistentContext(userDataDir,{
headless: false,
args: [
`--disable-extensions-except=${pathToExtension}`,
`--load-extension=${pathToExtension}`
]
});
const backgroundPage = browserContext.backgroundPages()[0];
// Test the background page as you would any other page.
await browserContext.close();
})();
which I am unable to understand that how this would be configured and in which file should I add this code. Can anybody help me in this regard please?
Firstly : i went through many ( MANY ) post about this problem, tested them all, but it seems that i'm cursed, or something like that ?
I'm working on expo with the LAN method, on iOs.
My back is on .Net Core 3.
My iPhone is on the same Wifi than my computer.
And my computer is running my .Net back server.
I found at that localhost cannot be handle by expo/react-native. So i tried the IP adresse method and change my back adress and the adress that my front was trying to fetch.
Tried the infoPlist with expo. Tried some mysterious things that i don't fully understood with my .Net server. Also tried to turn off my firewall, it didn't change anything.
Well, i'm not used to post because existing posts often answer my question.
Here is my code about my fetch method :
export async function callPlanning() {
try {
let response = await fetch(
"http://my.Ipv4.adress:myApiPort/myRoute",
);
let responseJson = await response.json();
return responseJson;
} catch (error) {
console.error(error);
}
}
My Api is working well on Postman.
And i can call the facebook test api with this function within my app.
Here is my app code where i'm calling this fetch function :
export default class BetaserieScreen extends Component {
constructor(props) {
super(props)
this.state={
response: null,
};
this.askPlanning = this.askPlanning.bind(this);
}
askPlanning = () => {
this.setState({
response: Back.callPlanning(),
})
}
render() {
return (
<View style={styles.MainContainer}>
<Text> Beta Serie </Text>
<TouchableHighlight onPress={this.askPlanning}>
<Text>Planning</Text>
</TouchableHighlight>
</View>
);
}
}
If you see anything that could andwer my question or about my code : i'll take it.
I'm on it for 2 days, and i've to find a solution...
If you need any other information about my system or file about my project, feel free to ask for it if you think you can help me with this problem.
I'll be glad.
the reason is ios blocks the requests made with http protocol by default
check in here https://reactnative.dev/docs/network
What I am trying to achieve:
I'd like to set up an electron project with a proper headless end-to-end testing configuration.
Issues encountered
Spectronjs seems to be the solution to achieve so. However there is no configuration to prevent the window from opening on each test. Reading some of the threads on the repository + the documentation of electron in regards to testing mentions Xvfb. I've tried to get my head around this but understand so far that this cannot be installed on Windows? And that there is no alternative.
The list on the page includes other options such as Appvoyer or CicleCI but these again are new and I am barely able to find a guide around these not to mention, I am not really liking that I have to do all these steps (link to github/bitbucket account, etc).
I've also tried to go through demo applications from the electronjs list page, but not all of them do have tests, and when they do, they are sometime written in what seems to be a different programming language, or specifically aimed for angular or react, while on my end I am aiming to use vuejs.
Can anyone point me to a clean example of an offline end to end headless test of an electron app on Windows?
There are several options how to E2E test an Electron app, unfortunately none of them is truly headless. On Windows you do not need Xvfb, it is a Linux thing. On Windows there is a "screen" available even in CI environments (I have experience with Appveyor and Azure Pipelines).
Puppeteer-core (Puppeteer-core does not contain chromium)
Spectron
Selenium-webdriver
Webdriver.io
In the past I used Spectron, but I recently switched to Puppeteer and I am very happy with the switch.
Short Puppeteer try out test file:
const electron = require("electron");
const puppeteer = require("puppeteer-core");
const delay = ms =>
new Promise(resolve => {
setTimeout(() => {
resolve();
}, ms);
});
(async () => {
try {
const app = await puppeteer.launch({
executablePath: electron,
args: ["."],
headless: false,
});
const pages = await app.pages();
const [page] = pages;
await page.setViewport({ width: 1200, height: 700 });
await delay(5000);
const image = await page.screenshot();
console.log(image);
await page.close();
await delay(2000);
await app.close();
} catch (error) {
console.error(error);
}
})();
I am testing and building an electron app in Azure Pipelines (free for open-source projects) on Win, Linux and MacOS with this config:
azure-pipelines.yml
The PouchDB data is getting remove after my Cordova base app is "hard" close .
Here are the steps :
Install the app
save some data in PouchDB name test
verify that the data is saved
close the app (on iOS double click the hone button)
reopen the app
Verify that saved lost
This only happen on the first install
As a test I created two button on a form with a sample code
$scope.saveme=function(){
var db =new PouchDB("test");
var todo = {
_id: new Date().toISOString(),
title: "test",
completed: false
};
db.put(todo, function callback(err, result) {
if (!err) {
alert('Successfully posted a todo!');
}
else{
alert(err);
}
});
}
$scope.showme = function(){
var db =new PouchDB("test");
db.allDocs({include_docs: true, descending: true}, function(err, doc)
{
alert(JSON.stringify(doc));
});
}
ios version: 4.5.4
cordova :6.5
pouch : 6.4.1
Can you please let me know how to resolve this issue
Sometimes IOS delete localstorage for his internal cleaning policy, this issue also may be happend in Android 6+ platforms.
Try to use this plugin, to persist localstorage info in sharedPreferences on IOS platform.
Cordova persist localStorage
Git Repository
I have an issue related to socket.io on its nodejs server. Issue is something related to socket.io is not working on IOS mobile browser in IOS8+. I have searched for it and went through some solutions but nothing worked.
Here are the issue links:
https://github.com/Automattic/socket.io/issues/976
http://www.codedisqus.com/7yzSqUgqge/socketio-working-on-desktop-safari-chrome-but-not-mobile.html
Here is the code
io.sockets.on('connection', function(socket) {
process.emit('client-connection', socket.id);
socket.on('authenticate', function(message) {
console.log('Authenticating client with key "' + message.authToken + '"');
authenticateClient(socket, message);
});
socket.on('message', function(message) {
if (io.sockets.sockets[socket.id] && message.hasOwnProperty('type')) {
if (message.hasOwnProperty('channel')) {
if (settings.clientsCanWriteToChannels || ChannelIsClientWritable(message.channel)) {
process.emit('client-message', socket.id, message);
}
}
return;
}
});
socket.on('disconnect', function () {
console.log("in disconnect");
process.emit('client-disconnect', socket.id);
cleanupSocket(socket);
});
})
Please let me know.
The basic issue is that when I try to open a session on browser it works fine and if I try to do the same on iPhone device browser it fails to work.
As per requirement the issue was IOS socket was not opening over SSL in mobile browsers. I have reinstalled the SSL certificate with complete code packet and it worked for me.
There might be some issue with SSL code packet due to which configuration was not complete.