I am developing an mobile application for android using Ionic and Web Api.
The application working fine when I run this app on the browser emulator but when I trying to deploy on real device it gives me an error login failed.
In app.js
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'services.hub', 'ngStorage', 'angularUUID2', 'ui.bootstrap', 'roy.signalr-hub','angularMoment'])
.constant('/api', {
url: 'http://ipAddress/api'
})
ionic.project file
{
"name": "ChatApp",
"app_id": "",
"proxies": [
{
"path": "/api",
"proxyUrl": "http://ipAddress/api"
}
]
}
Having an login screen click on login should be happen. I am not able to debug the code using real device also.
If you are working only on Android Device, I will suspect you are working on a Windows. If that's the case, then when you run the project in your device, the console should be working. If it does not show you any error, then there's a logic error in the code. But as a suggestion, use console.log on cases like this one.
May be you can use console.log() or 'ionic alert()'.
Related
I'm having an issue where Metamask's mobile browser simply isn't injecting window.ethereum at all into my website. This is extra confusing since I'm doing everything the same way I did in a previous website that worked fine.
if (window.ethereum) {
this.handleEthereum();
} else {
window.addEventListener('ethereum#initialized', this.handleEthereum, {
once: true,
});
}
To confirm that window.ethereum is never injected I also just output it on the screen and it's stays undefined indefinitely.
Everything works completely fine using a desktop browser of course. It's only an issue with metamask's mobile browser.
I'm new to XamarinUITest and I am having trouble running it on real devices locally (in preparation for AppCenter Test).
When I run it using an Android emulator, the test runs smoothly, passes and completes.
When I run it on a real device connected to my machine (OnePlus 5T) I get the following issues:
Message:
System.Exception : Post to endpoint '/ping' failed after 100 retries. No http result received
Stack Trace:
AppInitializer.StartApp(Platform platform) line 24
Login.BeforeEachTest() line 25
Standard Output:
Full log file: C:\Users\Steve\AppData\Local\Temp\uitest\log-2021-11-25_13-54-49-953.txt
Skipping IDE integration as important properties are configured. To force IDE integration, add .PreferIdeSettings() to ConfigureApp.
Android test running Xamarin.UITest version: 3.2.3
Initializing Android app on device 3acaec7 with apk: C:\Users\Steve\source\repos\MyTestApp\MyTestApp.Android\bin\Dev\com.mytestapp.dev-Signed.apk
Skipping local screenshots. Can be enabled with EnableScreenshots() when configuring app.
Signing apk with Xamarin keystore.
I have internet permissions on in my AndroidManifest.xml file.
AppInitializer
public static IApp StartApp(Platform platform)
{
try
{
if (platform == Platform.Android)
return ConfigureApp.Android.ApkFile(#"C:\Users\Steve\source\repos\MyTestApp\MyTestApp.Android\bin\Dev\com.mytestapp.dev-Signed.apk").StartApp();
else
return ConfigureApp.iOS.StartApp();
}
catch(Exception ex)
{
throw(ex);
}
}
I get this same issue if I try upload it to AppCenter. If I run the app when the APK file is already on the device then the test loading indicator keeps spinning forever.
I have tried .InstalledApp() instead and also had no luck on real devices. This is v important so I really appreciate everyone chimming in. Thanks.
I need to be able to launch my Electron app from the the browser (like sign in to Slack does). I know that I can add my protocol name to my Electron app using app.setAsDefaultProtocolClient(protocol[, path, args]) in Electron.
Then in electron-builder, I can use the package.json config build.mac with the extendInfo property to define "The extra entries for Info.plist". This however is the only instructions the docs give on how to use it.
What is the correct way add a protocol to the macOS info.plist using electron and electron-builder config build.mac.extendInfo and be able to use it as described?
(Posted a solution on behalf of the question author to move it to the answer space).
It now works with the following - I have added this to my Electron package.json:
"protocols": {
"name": "my-app",
"schemes": [
"my-app"
]
},
"mac": {
"target": "dmg",
"extendInfo": "my-app"
},
I have this in the electron.js:
app.setAsDefaultProtocolClient('my-app');
And this in my React browser client app code to launch the application from the browser:
document.location = 'my-app://open?url='
This question relates to how custom schemes are used to receive OAuth responses, as in my code sample which you can run locally, then use deep linking etc:
Code
Blog Post
Points of interest:
An interstitial web page returns control to the browser app - see this page
My package.json exposes the scheme for Electron deployment
This should give you something to compare against. Here is the key code:
INTERSTITIAL WEB PAGE INVOKING APP
window.addEventListener('DOMContentLoaded', function() {
var redirectUri = 'x-mycompany-desktopapp:/callback';
if (window.location.search) {
redirectUri += window.location.search;
}
document.getElementById('continueButton').onclick = function() {
window.location.href = redirectUri;
};
}
REGISTERING THE SCHEME
This gets picked up by Electron packager and included in platform specific binaries, resulting in OS specific registration:
"build": {
"protocols": {
"name": "finaldesktopapp",
"schemes": [
"x-mycompany-desktopapp"
]
}
},
RECEIVING NOTIFICATIONS
This enables the following code to work in the main side of the app, as specified in the main.ts file:
app.setAsDefaultProtocolClient(this._configuration.oauth.privateSchemeName);
Finally you register a callback that can parse the URL and take whatever is the appropriate action - completing a login in my case.
private _receiveNotificationInRunningInstance(privateSchemeUrl: string) {
}
The mechanics are a little tricky and the notification is received differently on macOS to Windows / Linux. See this source file and its comments which explain the details.
So I've been working on a xamarin PCL project targeting android and windows store app and I've had this issue for about two weeks now. One of the very first things this app does is to make an http request to a yahoo service when the user tries to search for something.
Now, on the windows store app project, this works just fine. However, whenever I'm debugging the android project, this fails miserably. It times out and I get a TaskAbortedException.
I've navigated with the browser within the android emulator to the restful service url and I do get a response in the browser but nothing when I make the http request. I have tried everything I could think of but no cigar. I have researched this for weeks now and I have yet to find an answer. It should be noted that I'm making the request within the PCL project with HttpClient.
Here's the code where this happens:
var queryUrl = string.Format(QUERY_URL_TEMPLATE, TickerSearch);
try
{
var requestTask = httpClient.GetStringAsync(queryUrl);
requestTask.ContinueWith(t =>
{
var responseDto = JsonConvert.DeserializeObject<TickerSearchResultDto>(t.Result);
TickerSearchResults = responseDto.ResultSet.Result;
});
}
catch (Exception ex)
{
}
Any help is greatly appreciated.
I am creating a firefox OS application, I want the user to be able to share a link through any application installed and eligible (facebook, twitter etc). I saw android has this kind of feature and firefox OS has it as well, as I saw it in one of it's built in applications. Went through Web API, didn't find a suitable match,
Any ideas how to do it?
This is the intended use of the Web Activity API . The idea is that applications register to handle activities like share. The Firefox OS Boiler Plate app has several examples of using Web Activities. In that example a user could share a url using code like:
var share = document.querySelector("#share");
if (share) {
share.onclick = function () {
new MozActivity({
name: "share",
data: {
number: 1,
url: "http://robertnyman.com"
}
});
};
}
Any app that handles the share activity will be shown allowing the user to pick the proper app to handle the share.