I am trying to get my trigger.io app to receive push notifications from parse. I've set up an account with Parse.com, installed and configured the parse trigger.io module and added the relevant setup code to my app.
Here is the code from my client app:
forge.parse.installationInfo(success, error);
function success(info){
forge.logging.log("installation: "+JSON.stringify(info));
}
function error(info){
forge.logging.log("Parse error! "+JSON.stringify(info));
}
forge.parse.push.subscribe("beta-testers",function () {
forge.logging.info("subscribed to beta-tester push notifications!");
},function (err) {
forge.logging.error("error: "+ JSON.stringify(err));
});
forge.event.messagePushed.addListener(function (msg) {
forge.logging.log(JSON.stringify(msg));
});
The app appears to successfully connect to Parse.com.
It logs all the relevant confirmation messages:
(I have purposely blanked out my device ID)
[INFO] Pausing webview while application not focussed.
[INFO] Checking for reload update.
[INFO] Android remote debugging disabled.
[INFO] Android hardware acceleration enabled.
[INFO] Loading live page in webview: http://10.56.2.49:31337/src/index.html
[INFO] Application in focus, resuming webview.
[INFO] No reload update available.
[INFO] [FORGE] 'installation: {"id":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"}'
[INFO] [FORGE] 'subscribed to beta-tester push notifications!'
[INFO] Checking for reload update.
[INFO] No reload update available.
The devices I am testing (AVD emulator + .apk on phone) both seem to register on parse.com; when I choose recipients to send a notification to the blue menu bar reads "This will be sent to 2 devices".
So as far as I can tell everything is set up correctly.
However if I send the notification neither of my devices receives it.
The forge.io log remains quiet and the "Pushes Sent" column on the parse.com dashboard reads "0" for all my sends.
I've reached the stage where I'm not sure how to debug this any further.
Your help would be greatly appreciated!
Antoine van Gelder at Trigger.io support managed to help me solve this problem.
I was using Forge serve to test the app instead of running an actual compiled instance of the app.
Thank you Antoine!
Related
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 have a finished application which I would like to make available to run on the iOS and Android platforms. I have tested the application as much as possible and it works without problem. But I know there is always the chance that something might go wrong and I could get an exception.
My question is how can I deal with this or what should I do. What happens on the phone, if a Forms application is deployed and there is an exception.
Would appreciate any advice or even links as to how this is handled.
If an exception is thrown and not handled by your code, the app will stop working (i.e. crash).
In order to handle these crashes we are using MS AppCenter (the successor to HockeyApp/Xamarin AppInsights).
You'll have to create a project there (one for each platform), and add the NuGet package to your projects. Afterwards you can initialize it with
AppCenter.Start("ios={Your App Secret};android={Your App Secret}",
typeof(Crashes)); // you'll get the app secrets from appcenter.ms
Crashes will be logged to AppCenter now and you'll be informed whenever there is a new crash.
Please note that it's best practice (if not required by law), that you ask the user for consent before sending the crash report (see here). You are using the delegate Crashes.ShouldAwaitUserConfirmation for that matter. You could for example show an action sheet with Acr.UserDialogs
private bool AwaitUserConfirmation()
{
// you should of course use your own strings
UserDialogs.Instance.ActionSheet(
new ActionSheetConfig
{
Title = "Oopsie",
Message = "The app crashed. Send crash to developers.",
Options = new List<ActionSheetOption>
{
new ActionSheetOption("Sure", () => Crashes.NotifyUserConfirmation(UserConfirmation.Send)),
new ActionSheetOption("Yepp, and don't bug be again.", () => Crashes.NotifyUserConfirmation(UserConfirmation.AlwaysSend)),
new ActionSheetOption("Nope", () => Crashes.NotifyUserConfirmation(UserConfirmation.DontSend))
}
});
return true;
}
Although I have seen similar questions posted here, I have not been able to resolve my issue via plist settings. Any other ideas? Here is where I am:
Adding FB Login to a simple IOS app using the Parse framework
All versions are up-to-date as of today. XCode 7.1, IOS 9, Parse latest, FB SDK latest (4.7)
I have added the specified IOS 9 settings for the FB SDK in my plist. I even combined the lists to include the extra setting required for FB SDK 4.7.
The mystery:
last night I could not get this to run on my simulator, but after
re-adding the plist settings and re-importing all the libraries, I
finally got the FB login screens to show up on the iphone 6 (has been
upgraded to IOS 9). I couldn't get it to run on the simulator but i
left it at that.
now today i tried it on the iphone again and i keep getting the ATS-looking errors.
On the iphone the error is:
Cannot Verify Server Identity. The identity of "m.facebook.com" cannot be verified by Safari. Review the certificate details to continue.
In the XCode console the error is:
FBSDKLog: WARNING: FBSDK secure network request failed. Please verify you have configured your app for Application Transport Security compatibility described at https://developers.facebook.com/docs/ios/ios9
It seems to me that the plist fix is allowing the FB Login to work in my simulator, but why wouldn't it also work on the iphone? Could this have anything to do with Parse? Below is my login code:
class LoginViewController: UIViewController, PFLogInViewControllerDelegate, PFSignUpViewControllerDelegate, UITextFieldDelegate {
#IBAction func FBLoginButtonPressed(sender: AnyObject) {
// Set permissions required from the facebook user account
var permissionsArray : [String]?
permissionsArray = ["user_about_me"]
var userBlock : PFUserResultBlock?
// Login PFUser using Facebook
PFFacebookUtils.logInInBackgroundWithReadPermissions(permissionsArray, block: userBlock)
PFFacebookUtils.logInInBackgroundWithReadPermissions(permissionsArray) {
(user: PFUser?, error: NSError?) -> Void in
if let user = user {
if user.isNew {
print("User signed up and logged in through Facebook!")
} else {
print("User logged in through Facebook!")
}
self.performSegueWithIdentifier(self.tableViewSegue, sender: nil)
} else {
print("Uh oh. The user cancelled the Facebook login.")
}
if let e = error {
print(error)
}
}
print(userBlock.debugDescription)
}
picture of plist
Okay, the mystery has been solved. Parents of teens may be able to relate.
It turns out that last night when the login was working on my teen's iphone, it was set to use mobile data ON PURPOSE to bypass the content filtering settings on our network! The reason I didn't realize this today was because the FB app seemed to be working on the iphone (upon later scrutiny I see that there was just some cached content), and my mac is set to bypass the content filtering. So this is why it worked on the simulator but not on the iphone (when the iphone was set to use wifi and not mobile data).
So the FB error was a red herring. I just wasn't looking down that path...
I added Google Analytics SDK to my project, following the provided instructions on the guide by Google. However, when I try to track some events, this is the debug output:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[…]
// Google Analytics
[GAI sharedInstance].trackUncaughtExceptions = YES;
[GAI sharedInstance].dispatchInterval = 20;
[[[GAI sharedInstance] logger] setLogLevel:(PADEV ? kGAILogLevelVerbose : kGAILogLevelError)];
[[GAI sharedInstance] trackerWithTrackingId:#"UA-XXXXXXXX-Y"]; // This is obviously replaced with my tracking ID
return YES;
}
and
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:#"article"
action:#"read"
label:#""
value:self.post[#"id"]] build]];
Log:
2014-11-12 01:02:25.144 PonzApp[5236:112706] INFO: GoogleAnalytics 3.10 -[GAIBatchingDispatcher didSendHits:response:data:error:] (GAIBatchingDispatcher.m:208): Hit(s) dispatched: HTTP status -1
2014-11-12 01:02:25.146 PonzApp[5236:112781] INFO: GoogleAnalytics 3.10 -[GAIBatchingDispatcher deleteHits:] (GAIBatchingDispatcher.m:509): hit(s) Successfully deleted
2014-11-12 01:02:25.147 PonzApp[5236:112781] INFO: GoogleAnalytics 3.10 -[GAIBatchingDispatcher didSendHits:] (GAIBatchingDispatcher.m:219): 1 hit(s) sent
It says that the hits are sent but the HTTP status is weirdly -1 and if I check on the dashboard, section “real-time”, nothing appears.
What could be wrong?
From Google Analytics tracking setup
Once you've correctly installed the tracking code snippet, you should
allow up to 24 hours for data to appear in your account. If it has
been more than 24 hours and you're still not seeing any data, take a
look at the list of possible reasons below:
Once the system has detected your tracker you will start seeing data in the real-time reports. Some of the data may also appear in the standard reports but it is not reliable as it takes 24 hours for data to finish processing.
All and all your code looks fine you just need to wait. The above is the same even though it is a application tracking. I suspect it takes time for Google to set up the new account on there side.
For me the problem was that I was testing it in simulator... :|
If you are using simulator to test it, make sure to press command + shift + H on the simulator to back to home since the data will be sent when it's on background.
I am trying to import a project and run it onto iPhone Simulator on Appcelerator, but I am getting a message on console that says,
[WARN] : The Ti.Geolocation.purpose property must be set.
[INFO] : {"source":{"cache":false},"type":"error"}
I have spent more than 2 hours on trying to eradicate the issue.
Also, Please share useful resources about appcelerator app lifecycle.
It says "The Ti.Geolocation.purpose property must be set."
I would try something like
Ti.Geolocation.purpose = "Find restaurants near you";
iOS want to let the user know why your App wants to know his location. The user must allow this Geolocation permission. Thats why you should surround your location requests with an if-statement:
if (Titanium.Geolocation.locationServicesEnabled){
Titanium.Geolocation.getCurrentPosition(function(e){
Ti.API.info(e.coords);
}
}else{
Titanium.UI.createAlertDialog({title:'Location Service', message:'Please turn on your location services.'}).show();
}
The parameters to be sent to the Call, were wrong.