Keyboard doesn't show for TextInput in react-native android - android

I have a react-native android app and the keyboard does not show on any of the text inputs, including the ones rendered by FBLogin. I have tried it in Genymotion, and on Samsung and Nexus devices. The keyboard does show on iOS.
I get this log message on startup.
"Unable to dispatch keyboard events in JS as the react instance has not been attached"
let options = {
order: ['email', 'password'],
fields: {
email: {
autoCapitalize: "none",
keyboardType: "email-address",
autoCorrect: false,
returnKeyType: "done",
enablesReturnKeyAutomatically: true,
onSubmitEditing: () => this._submitIfFilled('password')
},
password: {
autoCapitalize: "none",
autoCorrect: false,
password: true,
secureTextEntry: true,
returnKeyType: "done",
enablesReturnKeyAutomatically: true,
onSubmitEditing: () => this._submitIfFilled('email')
},
}
<Form
onChange={this._onChange.bind(this)}
value={this.state.formValue}
ref="form"
type={User}
options={options} />

Related

voice confirmation on an alert confirm window on Ionic

I am trying to confirm not by typing the button but by replying verbally on an alert window. I have already installed alertController and speechRecognition but I don't know how to make them interact together. This is my code :
presentAlertConfirm() {
this.alertController
.create({
header: 'object detection,
message: 'Are you sure you want to confirm?',
buttons: [
{
text: 'NO',
role: 'cancel',
cssClass: 'secondary',
handler: (data) => {
this.statusConfirm = 'confirmation canceled';
},
},
{
text: 'SI',
handler: () => {
this.statusConfirm = 'confirm OK';
this.viewObjectDetail;
},
},
],
})
.then((confirmElement) => {
confirmElement.present();
});
}

AdaptiveCard button with Action.submit not working on android device

I have developed a bot that has an invite card when the user did not add the bot yet, it will return the following JSON to render the AdaptiveCard:
{
body: [
{
text: translations['MsTeams::AdaptiveCardBodyLooksLikeTryToUseApp'],
wrap: true,
type: 'TextBlock',
},
{
text: translations['MsTeams::AdaptiveCardBodyNeedToInviteApp'],
wrap: true,
type: 'TextBlock',
},
],
actions: [
{
data: {
actionId: 'INSTALL_BOT_SUBMIT',
cancel: true,
},
title: translations['MsTeams::Cancel'],
type: 'Action.Submit',
},
{
data: {
msteams: {
justInTimeInstall: true,
},
actionId: 'INSTALL_BOT_SUBMIT',
},
title: translations['MsTeams::Invite'],
type: 'Action.Submit',
},
],
type: 'AdaptiveCard',
version: '1.0',
}
And it's working fine on desktop, browser, and iOS devices, but not working on Android devices.
Here is the device & app info:
Android device version: 8.0.0
MS teams app version: 1416/1.0.0.2021010802
This is just an idea, but I see lots of hanging commas (e.g. type: 'TextBlock',). It might be that the Android parser is stricter on this - try remove them and test again.

React Native App renders nothing without errors

I am building react native app and when I run it on android it renders nothing, as well it doesn't throw any errors...
I don't know which piece of code to put here so please tell me in the comments what should I add from the code here.
This is App.js file(react-native-navigation is being used here!):
Navigation.startTabBasedApp({
tabs:[
{
screen:"APB.ChoosePlatformScreen",
label: "Log In",
title:"Log In",
icon: HomeIcon,
},
{
screen: "APB.ResgisterScreen",
label: "Register",
title:"Register",
icon: HomeIcon
},
],
appStyle: {
tabBarBackgroundColor: "#e8e8e8",
tabBarButtonColor: "#555",
tabBarSelectedButtonColor: 'black',
tabBarSelectedBackgroundColor: "#e8e8e8",
forceTitlesDisplay: true,
showLabel: true,
},
tabBarOptions: {
showLabel: true
}
})
Above all of this are all the file imports an all screens are registered, I didn't put it in so the code is not too long.

Cannot get notifications when my Ionic 3 app is in foreground ( For iOS ), Android works fine

The payload I am sending is fine, searched for this a lot, Android foreground notifications are working fine. And in iOS, when the app is in the background or app is closed, I receive notification correctly.
But when the app is in the foreground, I don't get the notification, neither the .on('notification', ()=>{}) is triggered. Any ideas would be helpful.
Already gone through a lot of stuff.
const options: PushOptions = {
android: {},
ios: {
"sound": "true",
"alert": "true",
"badge": "true",
"clearBadge": "true"
},
windows: {},
browser: {
pushServiceURL: 'http://push.api.phonegap.com/v1/push'
}
};
const pushObject: PushObject = this.push.init(options);
pushObject.on('notification')
.subscribe((notification: any) => {
// {
// additionalData: {
// typeData: {}//Sent from server,
// coldstart: "false",
// foreground: "false"
// }
// }
let alertme = this.alert.create({
title : "GOT NOTIFIED",
subTitle : JSON.stringify( notification ),
buttons : [{
text: 'Ok',
handler: () => {
}
}]
});
alertme.present();
});

Problems to capture pictures through Sencha Touch

i'm trying to capture pictures in a app using by Sencha Touch 2.3.1 and Cordova 3.4.1-0.1.0.
Reading the docs (http://docs.sencha.com/touch/2.3.1/#!/api/Ext.device.Camera-method-capture) it looks very easy and simple, but i'm having a very weird experience.
First i create a Sencha Touch app and initialize Cordova on in it
sencha app generate MyApp ./MyApp
cd ./MyApp
sencha cordova init
At this point, when i try to build, it works fine on a real device, android emulator or even on browser.
Then, i changed Main.js to add the capture feature.
Ext.define('CameraTest.view.Main', {
extend: 'Ext.tab.Panel',
xtype: 'main',
requires: [
'Ext.TitleBar',
'Ext.device.*'
],
config: {
tabBarPosition: 'bottom',
items: [
{
title: 'Welcome',
iconCls: 'home',
styleHtmlContent: true,
scrollable: true,
items: {
docked: 'top',
xtype: 'titlebar',
title: 'Welcome to Sencha Touch 2'
},
html: [
"You've just generated a new Sencha Touch 2 project. What you're looking at right now is the ",
"contents of <a target='_blank' href=\"app/view/Main.js\">app/view/Main.js</a> - edit that file ",
"and refresh to change what's rendered here."
].join("")
},
{
title: 'Camera',
iconCls: 'action',
layout: {
type:"vbox",
pack:"center",
align:"center"
},
items: [
{
docked: 'top',
xtype: 'titlebar',
title: 'CameraTest'
},
{
xtype: 'panel',
html: '<img style="height: 200px; width: 200px;" src="http://placehold.it/200x200" />'
},
{
xtype: "button",
text: "Photo",
handler: function() {
function success(image_uri) {
var img = Ext.ComponentQuery.query("image")[0];
img.setSrc(image_uri);
}
function fail(message) {
Ext.Msg.alert("Failed: " + message);
}
Ext.device.Camera.capture({
sucess: success,
failure: fail,
quality: 50,
destination: 'data',
source: 'camera'
});
}
}
]
}
]
}
});
Done, the app stops loading. It stucks in the appLoadingIndicator and doesn't reach the tab panel component.
However, if i open it in a browser it works just fine.
I don't know even how to debug this.
This is the screen that the app gets stuck
It appears that you may be mixing up some of the parameters.
capture( options, scope, destination, encoding, width, height )
options = an object, which in your case would have {success:, failure:, quality:, source}, ...
and, destination: is not part of the options object, but its own parameter (as are, scope, encoding, width, and height)
I just solved it!
Reading these Cordova docs: http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html i discovered that i need to install the plugins before using the APIs =P.
Doing this solved everything:
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git

Categories

Resources