I am just about to release an app and I saw this stackoverflow question about things you should do before releasing an app. It tells me to use ACRA so I followed the instructions on this page.
So know I have a class called MyApplication like so :
import android.app.Application;
import org.acra.*;
import org.acra.annotation.*;
#ReportsCrashes(formKey = "", // will not be used
mailTo = "c#gmail.com",
mode = ReportingInteractionMode.TOAST,
customReportContent = { ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.LOGCAT },
resToastText = R.string.crash_report_text)
public class MyApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
// The following line triggers the initialization of ACRA
ACRA.init(this);
}
}
Now apparently when my application crashes I think the user is supposed to be able to send the report somehow, so I put a null pointer in my app but it just crashes and nothing happens. Am I supposed to do anything else?
I guess you might not have registered your application on BugSense
Where you want to send the crash reporst that depands on you only. When you are using Google Docs (deprecated now), you have to use your formKey you got from your google docs document.
If you want to store the reports on your own server, you can leave the formKey field blank. The only thing you have to do is to enter a valid url to your server (formUri = ....).
The other strings are for the type of dialog, which should or shouldn't appear.
Instead of using your own server, you can use BugSense. See this thread on stackoverflow.
As the use of Google Docs is deprecated for ACRA. I recommend you to use **BugSense** as your Back-End service:
1. Go to their site and sign in: http://www.bugsense.com/
2. Create a new project to monitor in BugSense site, as a result you will receive an API Key for this application.
3. Finally add this line to you Application class in you project:
#ReportsCrashes(formUri = "http://www.bugsense.com/api/acra?api_key=YOUR_API_KEY", formKey="")
Check out BugSense Docmentation
Related
I'm setting up the package react-native-moengage in my react-native app. Followed the guidelines here for react-native all the way to tracking events. Yet calling trackEvent on my code does not publish anything and does not throw an error at JS level.
Running on react-native:0.59and react-native-moengage:^3.0.0
Have not done anything weird beyond what is in the documentation, set up a service to call ReactMoE.trackEvent from sagas. I set up logs and indeed trackEvent is getting called
Pretty much this is it
import ReactMoE from 'react-native-moengage'
class MoengageService {
...
constructor() {
ReactMoE.isExistingUser(true);
}
setUser(userId: string, email: string, name: string) {
ReactMoE.setUserUniqueID(userId);
ReactMoE.setUserEmailID(email);
ReactMoE.setUserAttribute('inAppName', name)
}
unsetUser() {
ReactMoE.logout()
}
logEvent = (event: string, data = {}) => {
const timestamp = moment().valueOf()
const dataToLog = {
...data,
timestamp,
}
ReactMoE.trackEvent(event, dataToLog)
}
...
}
export const instance = new MoengageService()
I also succesfully set up moengage natively thanks to a previous SO question, or so I believe.
I would expect something to appear in the dashboard, it's blank with the big text up top saying I have not received anything in the last hour
How do I get it to push to dashboard?
EDIT
Just for clarification, I am not interested (yet) in push notifications or any of the like, which is why I skipped setting up firebase and everything
After Checking the logs and thinking out loud, I noticed the issue was that the dashboard was being misused, we were checking for debug logs on live instead of test.
If you followed the docs and see nothing, try to check which environment are you reading. Test for debug apps, Live for signed apps.
A helpful thing to check logs, adb logcat MoEngage_v${Your moengage native version here}
I'm trying to integrate the PayPal Here swipers into a Xamarin Android app. Everything is fine until I try and give my credentials to the SDK. Specifically, the line containing the call to PayPalHereSDK.SetCredentials
public void InitializeSdk( Context context, string serverName, string accessToken, string refreshUrl, string expires, IPayPalHereSdkWrapperCallback listener ) {
PayPalHereSDK.Init( context, serverName );
PayPalHereSDK.RegisterAuthenticationListener( this );
PayPalHereSDK.CardReaderManager.RegisterCardReaderConnectionListener( this );
if ( !string.IsNullOrEmpty( accessToken ) ) {
var credentials = new OAuthCredentials( accessToken, refreshUrl, expires );
PayPalHereSDK.SetCredentials( credentials, new SetAccessTokenResponseHandler( listener ) );
}
}
My SetAccessTokenResponseHandler class implements the Com.PayPal.Merchant.Sdk.Domain.IDefaultResponseHandler interface. As described above, the OnError function is called when call the PayPalHereSDK.SetCredentials function. I'm given the error code "BadConfiguration" and the message "Cannot proceed with this merchant account. ready"
I've searched Google high and low and, I believe, scoured SO pretty thoroughly. I can't seem to overcome the error, so I'm asking for help!
I think the paypal email is not verified properly. Please go through the merchant onboarding guide document to get more details regarding making the merchant eligible.
https://github.com/paypal/paypal-here-sdk-android-distribution/blob/master/docs/Merchant%20Onboarding%20Guide.pdf
Hope this helps. Cheers.
I'm not sure what exactly the issue was, but I ended up deleting the Sandbox App in my PayPal dev portal and creating a new one. Everything works now. head scratch
I resorted to this because, while trying to follow Sundar's suggestion, I started getting an "invalid scope" error. I had received them before and KNEW I had it fixed ( and no code had changed ). When I deleted/recreated the app, that error went away. Frustrating, but that's what worked!
I am trying to figure out how to add ACRA in my test project in Android Studio.
Following this article (which explains how to do it in Eclipse) https://github.com/ACRA/acra/wiki/BasicSetup, I have passed all so far up to the point where is explains to annotate your Application class with #ReportsCrashes. In this part, I dont know what to put as formUri.
I am just creating my own test app (API22 Lollipop) and trying to add ACRA support to it. I don't have any server, it is just a simple Android app.
import org.acra.*;
import org.acra.annotation.*;
#ReportsCrashes(
formKey = "", // This is required for backward compatibility but not used
formUri = "http://www.backendofyourchoice.com/reportpath"
)
public class MyApplication extends Application {
}
What do I put as the formUri?
Can you explain what formUri is for and how it works as I am new to dev?
Please explain
Thanks,
formUri points to your crash report server.
There are many to choose from, commercial and free.
The ACRA wiki lists several.
ACRAlyzer is one, but you will need to host it yourself.
Read about Acralyzer: https://github.com/ACRA/acralyzer/wiki/setup
It is simple backend for ACRA reports.
#ReportsCrashes(
formUri = "https://[your.couchdb.host]/acra-[yourappname]/_design/acra-storage/_update/report",
formUriBasicAuthLogin="[reporteruser]",
formUriBasicAuthPassword="[reporterpassword]",
reportType = org.acra.sender.HttpSender.Type.JSON,
httpMethod = org.acra.sender.HttpSender.Method.PUT,
....
)
public class [YourApplication] extends Application {
#Override
public final void onCreate() {
super.onCreate();
ACRA.init(this);
}
There you will find the usage of the Acralyzer user interface: https://github.com/ACRA/acralyzer/wiki/usermanual
Am trying to send crash report from my applicatio to my domain or Mail but failed still.
To get the crash report in mail, I did
#ReportsCrashes(
formKey = "",
mailTo = "abc#gmail.com"
)
And the response is,
Sending file 1372758321000-approved.stacktrace
checkAndSendReports - finish
To get the crash report in my domain, I did
#ReportsCrashes(
formKey = "",
formUri = "http://www.abc.com/test1"
)
And the response is,
Sending file 1372856882000-approved.stacktrace
Failed to send crash report for 1372856882000-approved.stacktrace
org.acra.sender.ReportSenderException: Error while sending FORM report via Http POST
Any help will be handy for me and appreciated.
ACRA works for me sending reports by e-mail when I do exactly as they say in their docs:
#ReportsCrashes(mailTo = "reports#yourdomain.com", // my email here
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.crash_toast_text)
https://github.com/ACRA/acra/wiki/Report-Destinations#sending-reports-by-email
You are probably forgetting the toast part. Or can it be you don't have an e-mail program (such as when you're running on the simulator).
I think sending reports by Google docs are not supported anymore.
Your application class should look like this.
import android.app.Application;
import org.acra.ACRA;
import org.acra.ReportField;
import org.acra.ReportingInteractionMode;
import org.acra.annotation.ReportsCrashes;
#ReportsCrashes(mailTo = "user#domain.com", customReportContent = {
ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME,
ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL,
ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.LOGCAT},
mode = ReportingInteractionMode.TOAST, resToastText = R.string.crash_toast_text)
public class MyApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
ACRA.init(this);
}
}
No,not like Alex say,the mode property has no releation to the reporting type,you can see it in the source code in github
using the mailTo type,you should make sure that:
your app has the permission to connect network;
have an e-mail program in your device like Alex say;
have you invoked the ACRA.init(this) method in your application's oncreate()?
if all of these have done,then run your app,it will note you to configure the email,such as username and password and so on.
I am trying to configure ACRA for the first time. I have followed the Basic Setup guide :
1.Integrated the acra jar file to my app
2.Created a new class extending application class and have added the below code to it :
#ReportsCrashes(formKey = "", // will not be used
mailTo = "mymailId#gmail.com")
public class MyApplication extends Application
{
#Override
public void onCreate()
{
super.onCreate();
ACRA.init(this);
}
}
3.Made all necessary changes to manifest file
It seems that all is done correctly,I am able to get the below in logcat :
12-21 14:59:10.994: D/ACRA(28728): ACRA is enabled for com.android.demo.notepad1, intializing...
12-21 14:59:11.064: D/ACRA(28728): Using default Mail Report Fields
12-21 14:59:11.064: D/ACRA(28728): Looking for error files in /data/data/com.android.demo.notepad1/files
12-21 14:59:11.074: W/ACRA(28728): **com.android.demo.notepad1 reports will be sent by email (if accepted by user).**
But I am not able to get any mail :( !
As far i know, the mailTo option needs the user in order to send the email.
When an error occurs another mail client (such as Gmail.apk) has to be open to process the crash report and send e-mail. So the error will open a mail client and we need the user to click on send button.
Although a bit late, someone might find it useful anyways...
I did have at least a similar problem with ACRA 4.5.0 which I was able to resolve once all the other configuration options were actually set. This means – although partially labeled as optional – I had to give a value to the following options (in the #ReportsCrashes annotation)
resDialogText = R.string.crash_dialog_text, // Text to display upon crash
resDialogIcon = android.R.drawable.ic_dialog_info, //optional (apparently not). default is a warning sign
resDialogTitle = R.string.crash_dialog_title, // optional (apparently not). default is your application name
resDialogCommentPrompt = R.string.crash_dialog_comment_prompt, // optional (apparently not). when defined, adds a user text field input with this text resource as a label
resDialogOkToast = R.string.crash_dialog_ok_toast // optional (apparently not). displays a Toast message when the user accepts to send a report.
Though I had mode = ReportingInteractionMode.DIALOG, set which might be the source of my problems at least.
have not used "mailTo" field ,had only used #ReportsCrashes(formKey = "formkey")
Make sure you get the form key from google drive correctly
And on crash you will be getting the report on Google drive excel file
And also make sure you have added Internet permission and Added "MyApplication" in mainfeast
<manifest ...>
<application ... android:name="MyApplication">
...
</application>
<uses-permission android:name="android.permission.INTERNET">
</uses-permission>
</manifest>
Detail explanation is provided here http://acra.ch/