I have created an internal test for an app using the Google Play Console and sent the hyperlink to a test user. However, once the app is installed on the tester's phone and the Open button is tapped it gets stuck on the splash screen and will not go any further. The tester has tried restarting the phone, Force Stop the Google Play app, Clear Data and Clear Cache for Google Play app, uninstall/reinstall the app. None of these have helped. What would cause this behavior? What steps should I take next to debug/resolve this issue?
i solved my problem by putting try block before runApp(MyApp()) in main
void main() async {
WidgetsFlutterBinding.ensureInitialized();
try {
final InitialController _initialController = Get.put(InitialController(), permanent: true);
final BasketController _basketController = Get.put(BasketController(), permanent: true);
//final BackInterceptorController _backInterceptorController = Get.put(BackInterceptorController(), permanent: true);
await _initialController.tokenInit();
} catch (e) {
logger(e);
}
runApp(MyApp());
}
Related
I am implementing an APP with Xamarin.
The app need to refresh data through Wi-Fi with device and show new data on screen.
But when polling triggered. The app always stuck for few seconds.
protected async override void OnAppearing()
{
//Show new data when entering this page
await Polling();
}
async Task Polling()
{
await Read_Data();
Show_Data();
}
How could I do this without stuck. Make the app polling smoothly?
I want to call the Polling() every 30 seconds.
Thank you!
private async void SlidesCommandTapped(object obj)
{
if (!await Launcher.TryOpenAsync("com.microsoft.office.powerpoint://"))
{
await Launcher.OpenAsync(new Uri("market://details?id=com.microsoft.office.powerpoint"));
}
}
tryopenasync now working
if microsoft powerpoint app not present it opens playstore and tells you to install powerpoint app but right now if the app is installed too its going to playstore
Well your code should look something like below:
var isPowerPointAvailable = await Launcher.TryOpenAsync("com.microsoft.office.powerpoint://");
if (isPowerPointAvailable)
{
// this would change based on what file you want to open
await Launcher.OpenAsync("com.microsoft.office.powerpoint://");
}
else
{
await Launcher.OpenAsync(new Uri("market://details?id=com.microsoft.office.powerpoint"));
}
Goodluck,
Feel free to get back if you have queries
I'm creating a Discord Music Bot in discord.js, I already installed ffmpeg, and everything seems to work normally, but when I execute play command, bot joins a channel, send a message, but doesn't play anything, I've already checked console and it doesn't log anything.
I know it's not a problem with code since it works perfectly locally, the problem is when I try to use heroku, I thought it could be a opusscript problem but I don't know.
I don't find code relevant here, since it works perfectly in my localhost, but when I start to host it at Heroku, nothing happens.
Here you have it, maybe there's an error, but as I said I think the problem is with opusscript or node-opus.
Here are my Heroku buildpacks
And this is my code:
const ytdl = require('ytdl-core');
let voiceChn = message.member.voiceChannel;
if(!voiceChn) return message.channel.send('¡Join a voice channel first!.');
if(!args) return message.channel.send('Add a youtube URL to play it.');
voiceChn.join()
.then(connection => {
const url = ytdl(args.join(' '), { filter : 'audioonly' });
const dispatcher = connection.playStream(url);
message.delete();
message.channel.send('Now playing : '+ args);
}).catch(console.error);
For what its worth I am seeing a very similar issue. My bot should join the channel, play a sound clip from a S3 bucket (which is made public), and then leave.
Here's my code:
async function executePlaySoundCommand(message, filePath) {
try {
const voiceChannel = message.member.voiceChannel;
const connection = await voiceChannel.join();
console.log(`filePath: ${filePath}`);
const file = `${process.env.S3_URL}/${filePath}`;
console.log(`file: ${file}`);
const dispatcher = await connection.playArbitraryInput(file);
console.log('Playback finished');
dispatcher.on('end', () => {
voiceChannel.leave();
});
} catch (err) {
console.log(err);
}
}
Locally the bot will join the channel, play the sound and then leave as expected. However in heroku, the bot will join the channel, then immediately leave.
Below are the sanitized logs from heroku:
Executing <command-name> command
filePath: <audio-file>.mp3
file: https://s3-eu-west-1.amazonaws.com/<s3-bucket-name>/<audio-file>.mp3
Playback finished
I don't think there's anything wrong with my code(?), looking into ffmpeg protocols to see if I have missed something.
I created an Edge browser extension which uses Native Messaging to a native app running via a Desktop Bridge technology. I used the SecureInput as a sample, which contains the Edge extension, UWP host and a Win32 Desktop Bridge app.
I need the Win32 Desktop Bridge app to connect to a web service using HTTP and WebSocket, so I added an internetClientServer and a privateNetworkClientServer capabilities to the package manifest, beside the already existed runFullTrust one.
The Win32 Desktop Bridge app activates just fine, and it is able to connect to the web server using HTTP. But as soon as it tries to open a WebSocket connection, the BackgroundTaskInstance on the UWP host receives a cancellation request with a BackgroundTaskCancellationReason.SystemPolicy as a reason, and the Desktop Bridge application closes. Unfortunately, the documentation for the BackgroundTaskCancellationReason.SystemPolicy does not explain much about true reasons of the cancellation request.
I tried to use two WebSocket classes: the System.Net.WebSockets.ClientWebSocket and the Windows.Networking.Sockets.MessageWebSocket, with the same result. No fancy code, just regular
var socket = new MessageWebSocket();
...
await socket.ConnectAsync(new Uri("wss://127.0.0.1:9001/myservice"));
The same WebSocket service endpoint is available from other WS clients, so I guess there is no server/firewall/antivirus issue here.
I also played with the CheckNetIsolation tool, adding loopback exemption for the Edge browser and for the package, with no effect. The HTTP works fine without the loopback exemption.
What may be a true reason of the task cancellation, and what can be a possible way to prevent it?
Ok, I resolved the issue. Thanks to this comment by Tom Shane I stumbled upon, I realized that the BackgroundTaskCancellationReason.SystemPolicy tells that the background task is closed by the system to release some system resources, and that in my case it happened because I didn't obtain a deferral in my async event handler. When the event handler yielded without a deferral, the system decided it can shut the task down. Below is a digested version of the code:
static class Program
{
static AppServiceConnection connection = null;
[STAThread]
static void Main(string[] args)
{
Thread appServiceThread = new Thread(new ThreadStart(ThreadProc));
appServiceThread.Start();
Application.Run();
}
static async void ThreadProc()
{
try {
connection = new AppServiceConnection();
connection.AppServiceName = "...";
connection.PackageFamilyName = Windows.ApplicationModel.Package.Current.Id.FamilyName;
connection.RequestReceived += OnRequestReceived;
connection.ServiceClosed += OnServiceClosed;
var status = await connection.OpenAsync();
....
}
catch (Exception e) { ... }
}
private static async void OnRequestReceived(AppServiceConnection sender, AppServiceRequestReceivedEventArgs args)
{
var defer = args.GetDeferral(); // <== that was missing, rookie mistake!
try {
var msg = ParseMessage(args.Request.Message);
if (msg.type.Equals("ws")) {
// this method was truly async
// and every time it yielded the issue was revealed
await HandleWsMessage(request, msg);
}
else if (msg.type.Equals("http")) {
// but this method was actually synchronous despite being marked as "async"
// and it never yielded, masking the issue for HTTP client
await HandleHttpMessage(request, msg);
}
}
catch (Exception e) { ... }
finally {
defer.Complete();
}
}
}
I implemented an IBackgroundTask on Universal Windows 10 and it works like a charm but the problem is that i want to start the app that is associated to that background task if some action occurs. The code is simple:
public sealed class AdvertisementWatcherTask : IBackgroundTask
{
private IBackgroundTaskInstance backgroundTaskInstance;
public void Run(IBackgroundTaskInstance taskInstance)
{
backgroundTaskInstance = taskInstance;
var details = taskInstance.TriggerDetails as BluetoothLEAdvertisementWatcherTriggerDetails;
if (details != null)
{
//Do things
}
}
}
I've seen that you can create a ToastNotification like that:
Windows.Data.Xml.Dom.XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText01);
Windows.Data.Xml.Dom.XmlNodeList elements = toastXml.GetElementsByTagName("text");
foreach (IXmlNode node in elements)
{
node.InnerText = taskInstance.Task.Name+ " remember to uninstall task if not debugging";
}
ToastNotification notification = new ToastNotification(toastXml);
ToastNotificationManager.CreateToastNotifier().Show(notification);
The notification toast works good. It creates and prompts a notification and if you click it, the app that created this background task starts. This is the behaviour that I want but I want to start the app without having to click any notification. Is there any way to achieve this? Thank you.
TL;DR: I want to start the app that created the background task at some point of the code.
You can not programmatically launch URI or open app from background task. You can however display a reminder or toast notification to let user open your app.