How to use wifiwizard codorva plugin - ionic2

I just want to scan list of available Wi-Fi networks and connect to desired one, then send data from an ionic2 app.
I tried with few plugins but, couldn't use them in ioni2 app, so found this cordova wifiwizard and installed it .but, when I tried using that got some errors, could anyone sort out what was going wrong
getScanResult() {
WifiWizard.getScanResults(this.listHandler2, fail);
console.log();
}
listHandler2(a) {
console.log(JSON.stringify(a));
}
<button (click)="getScanResult();">Get Scan result</button>
When I tried the above code stuck with the error:
Cannot find name 'WifiWizard'
So I tried like this.
window.WifiWizard.getScanResults(this.listHandler2, fail);
Got the error:
Property "WifiWizard" does not exist on type "Window"

Related

AWS Amplify federated google login work properly on browser but dont work on Android

The issues are when I am trying to run federated authentication with the help of amplify auth method on the browser it works fine, but when I try to run it on my mobile.
It throws error No user found when I try to use Auth.currentSession() but the same work on the browser.
tried to search about this type of issue but I found related to ionic-cordova-google-plugin not related to AWS Amplify Federated Login Issue.
Updating the question after closing the question with less debugging information without asking for any information.
This is issues raised in git hub with respect to my problem.
Issue No. 5351 amplify js it's still in open state.
https://github.com/aws-amplify/amplify-js/issues/5351
Another issue 3537 which is still in Open
These two issues has the same scenario like me, I hope its enough debugging information, if more required mention comment instead of closing without notification, it's bullying for a beginner not helping
I fixed the above problem by referring a comment or wrapped around fix.
Link that will take to that comment directly link to comment.
First read the above comment as it will give you overall idea of what exactly the issue is instead of directly jumping to the solution.
Once you read the comment you will be little unclear with respect to implementation as he has use capacitor and not every one are using capacitor.
In my implementation I ignore this part as I am not using capacitor.
App.addListener('appUrlOpen')
Now lets go to main step where we are fixing this issue, I am using deep links to redirect to my application
this.platform.ready().then(() => {
this.deeplinks
.route({
"/success.html": "success",
"/logout.html": "logout",
})
.subscribe(
(match: any) => {
const fragment = JSON.stringify(match).split('"fragment":"')[1];
// this link can be your any link based on your requirement,
// what I am doing it I am passing all the data which I get in my fragments.
// fragments consists of id_token, stage, code,response type.
// These need to be passed to Ionic in order for Amplify to run its magic.
document.location.href = `http://192.168.1.162:8100/#${fragment}`;
},
(nomatch) => {
console.log("Got a deeplink that didn't match", nomatch);
}
);
});
I got this idea by referring the issue in which the developer mentioned of sending code and state along with application deep linking URL.

PowerBI Embedded Export Data fails with "ExportDataFailed: Error generating details table"

Using powerbi-client 2.6.1:
let report; // set earlier
report.getPages().then(pages => {
const page = pages[0]
page.getVisuals().then(visuals =>
visuals[0].exportData().then(console.log)
)
})
This code throws an error that looks like this:
{
"message":"ExportDataFailed",
"detailedMessage":"Error generating details table",
"level":3,
"errorCode":undefined,
"technicalDetails":{
"requestId": undefined,
"errorInfo": undefined
}
}
I'm sure that the given page/visual are loaded, as they have finished rendering in the embed iframe. The visual in question has fewer than 1,000 rows so it's not the data limit.
Inspecting the code, I expect to see a POST request to be initiated when I call visual.exportData() but my network tab shows nothing.
Where is this error coming from?
More debugging information
The visual in question is a basic table with non-aggregated metrics.
Selecting the "export data" menu item in the ellipsis menu succeeds.
The error message suggests to me that the error logger blew up
What is the visual type you are trying to export data from?
Please note that export-data API works only if the visual use basic aggregations, and it doesn't work if the visihave measure.
Please read export-data docs and make sure you don't have some of the limitations described in the wiki.
In addition, you can do this sanity check: Go to powerbi.com, open your report there. then try to export to CSV. if it works for you, exportData API should work for you.

CaptureError.CAPTURE_INTERNAL_ERR on Android trying to use capture.captureImage

I am trying to write a hybrid app for Android using VS 2013 update 3 and the multi-device hybrid app extension (Cordova v3.5.0). Everything is working well except the Media Capture plugin. I am calling navigator.device.capture.captureImage(MediaCaptureSuccess, MediaCaptureError, { limit: 3 }) which opens up the camera app. I can take a picture but when I click Ok on the device, my error callback is executed with CaptureError.CAPTURE_INTERNAL_ERR with no other information. I have tried switching to org.apache.cordova.media-capture#0.3.4 (currently using 0.3.1) but when I try to compile, I get a plugman error when it tries to retrieve it. I have searched the debug output for clues and the only thing that I found was the following line "Unknown permission android.permission.RECORD_VIDEO in package..." but that seems to be a valid user permission. When I look at capture.java generated by the build, I can see that this error is returned if there is an IOException occurs.
Does anyone have any suggestions on how to fix this or what to check next?
Try this plugin
Config:
<vs:feature>org.apache.cordova.camera#0.3.0</vs:feature>
JS:
navigator.camera.getPicture(onSuccess, onFail, {
quality: 30,
destinationType: Camera.DestinationType.FILE_URI,
saveToPhotoAlbum: true
});

"Uncaught Error: element not specified" when integrate Facebook Javascript SDK with Turbolink (Rails 4)

I'm using Rails 4 with Turbolink and want to integrate Facebook Javascript SDK. If turn off Turbolink, everything seems okay. But when not, this error always appears when I call FB.ui:
Uncaught Error: element not specified all.js:82
This can be solved if I refresh the page.
Before this error, I have solved "FB not defined" error by this code:
window.fbAsyncInit = function() {
$(function() {
FB.init({
...
})
});
}
and Facebook JS SDK is got by:
<script src='//connect.facebook.net/en_US/all.js'></script>
I have read a lot of relative questions and answers but still haven't had solutions for this issue. How to solve this issue?
The reason is Turbolink doesn't reload all stylesheet when loading a new page.
You can make a function, then every time the page load, this function will be call again
fb_register = ->
# Your code here
And then, add this below
$(document).ready(fb_register)
$(document).on('page:load', fb_register)

Why am I getting "The ExternalInterface is not available in this container" in a Flex Mobile Project?

I am using StageWebView to show a local HTML page (using file://). I want to call a function in my flex mobile project to be called from a JS function. Using ExternalInterface, I have
in Flex -
ExternalInterface.addCallback("myFunction",myFunc);
in JS -
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
function showAlert()
{
alert("Going to call AS function");
thisMovie("ShowLocalHTML").myFunction("Hello");
return false;
}
I am getting "Error: Error #2067: The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime." when trying to run the application.
And my project targets Android platform. And I have Mozilla, Chrome installed on my desktop - although I am not user if that is relevant to the problem.
Please help in resolving this issue.
Since I am new to Flex and AS it took me a while to understand the problem. See http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html and http://sean.voisen.org/blog/2010/10/making-the-most-of-stagewebview/. What it means is External Interface is not available for use with StageWebView in AIR for android.
True, but you still can communicate js <> air if you are using an ANE solution. Check here https://github.com/myflashlab/webView-ANE I'm the coder of this ANE by the way! :)