守望者--AIR技术交流

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: ANE FlasCC 炼金术
查看: 2025|回复: 0
打印 上一主题 下一主题

ANE-Bugsnag

[复制链接]
  • TA的每日心情
    擦汗
    2018-4-10 15:18
  • 签到天数: 447 天

    [LV.9]以坛为家II

    1742

    主题

    2094

    帖子

    13万

    积分

    超级版主

    Rank: 18Rank: 18Rank: 18Rank: 18Rank: 18

    威望
    562
    贡献
    29
    金币
    52693
    钢镚
    1422

    开源英雄守望者

    跳转到指定楼层
    楼主
    发表于 2015-7-28 16:59:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    应用下载
    应用名称: ANE-Bugsnag
    支持64位: 支持
    当前版本: 未知
    运行平台: Android IOS 
    开发语言: ActionScript 3 JAVA Object-C 
    应用类别: ANE-多平台
    应用简介: Adobe AIR Native Extension (ANE) for the Bugsnag platform
    Bugsnag Air Native Extension

    This is an Adobe Air Native Extension for the Bugsnag bug reporting platform for iOS and Android applications. This extension allows you to track:

    • Native iOS and Android crashes
    • Unhandled Actionscript errors
    • Manual Actionscript errors/messages
    Version

    This extension uses the Bugsnag SDK version 4.0.7 for iOS and SDK version 3.2.6 for Android.



    Requirements

    This extension requires iOS 6.0 or higher and Android 2.2 (API level 8) or higher.

    Binary Files

    You can find the final compiled ANE binary along with the swc file in the bin folder.

    Setup the Extension

    Manifest Setup

    When using the extension on the Android platform you'll need to add the following permissions in the app manifest file:


    1. <font color="rgb(51, 51, 51)"><uses-permission android:name="android.permission.INTERNET" />
    2. <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    3. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/></font>
    复制代码


    There is no additional code required for the iOS platform.

    Project Setup

    Before you can begin tracking bugs you will need to set up a two new projects on the Bugsnag website. Create a project for iOS and another one for Android tracking. You'll need the API keys for each project.

    Initialize

    Start off by initializing the Bugsnag extension with your API key:

    1. <font color="rgb(51, 51, 51)">Bugsnag.init("IOS_KEY", "ANDROID_KEY");</font>
    复制代码
    NOTE: If you want to initialize Bugsnag when your application starts, you need to do so after theADDED_TO_STAGE event fires. Otherwise a crash can occur on iOS.

    1. <font color="rgb(51, 51, 51)">addEventListener(Event.ADDED_TO_STAGE, init);
    2. private function init(event:Event):void
    3. {
    4.     Bugsnag.init("IOS_KEY", "ANROID_KEY");
    5. }</font>
    复制代码
    Catch Unhandled Errors (Optional)
    Bugsnag can catch and report unhandled errors in Actionscript. You'll need access to your app's loaderInfo object do to this. Use the following code:
    1. loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, Bugsnag.handleUncaughtError);
    复制代码
    Alternatively you can catch unhandled errors yourself and pass them directly into Bugsnag for reporting:
    1. Bugsnag.notifyError(event.error);
    复制代码
    Unhandled errors and crashes in the native code are already set up and do not require any additional code.Stack Traces (Optional)
    If you'd like Bugsnag to record stack traces for errors (highly recommended), add the following code:
    1. Bugsnag.getStackTrace = function(error:Error):String{return error.getStackTrace();}
    复制代码
    Using the Extension
    Track Unhandled Actionscript Errors
    If you followed the setup instructions to catch unhandled errors, then these errors will be automatically reported to Bugsnag as they occur.Native exceptions and crashes are reported automatically.Track Handled Error
    You can easily track handled errors using the following code:
    1. try
    2. {

    3. }
    4. catch(e:Error)
    5. {
    6.     Bugsnag.notifyError(e);
    7. }
    复制代码
    You can also pass in a severity value to the method:
    1. Bugsnag.notifyError(new Error(), Severity.WARN);
    复制代码
    Track Manual Errors
    You aren't limited to tracking only Error objects. You can send a generic error:
    1. Bugsnag.notify("Big Error", "A really big error has occured");
    复制代码
    You can also add a severity to it:
    1. Bugsnag.notify("Big Error", "A really big error has occured", Severity.INFO);
    复制代码
    It may be helpful to provide a stacktrace of where the error occured:
    1. Bugsnag.notify("Big Error", "A really big error has occured", Severity.INFO, new Error().getStackTrace());
    复制代码
    Additional Settings
    User Data
    You can set custom data for users to track their errors:
    1. Bugsnag.setUser("123456", "user_123456", "user123456@example.com");
    复制代码
    By default the iOS extension will use the IDFV for the user id. Android will generate and save a random UUID value for the user id.Release Stage
    You can tell Bugsnag which release stage your app is in to more easily group errors:
    1. Bugsnag.releaseStage = ReleaseStage.DEVELOPMENT;
    复制代码
    By default the release stage is set to PRODUCTION.Auto Notify
    You can enable or disable auto notification of unhandled exceptions:
    1. Bugsnag.autoNotify = false;
    复制代码
    Notify Release Stages
    You can also tell Bugsnag to only notify errors in certain production stages:
    1. Bugsnag.notifyReleaseStages = [ReleaseStage.PRODUCTION];
    复制代码
    The code above restricts automatic notification to production stages only. Errors in all other production stages will be ignored.
    Custom Data and Tabs
    You can add custom data and custom tabs to your error reports. The following code adds custom data to the 'user' tab:
    1. Bugsnag.addAttribute("City", "New York", "User");
    复制代码
    You can also remove attributes:
    1. Bugsnag.removeAttribute("Attribute", "Tab Name");
    复制代码
    Or even remove entire custom tabs:
    1. Bugsnag.removeTab("My Tab");
    复制代码
    Context
    The context represents the state the application is in before the error. You can set the context:
    1. Bugsnag.context = "Store";
    复制代码
    Offline Mode


    If an error occurs while the user is offline, the error will be queued until network connectivity is re-established.

    Further Documentation


    You can learn more about the inner workings of the Bugsnag platform using the following resources:Compiling from Source


    You can compile the Air Native Extension from source by renaming the build/sample-build.conf file to build/build.conf, then changing the path settings to match your development enviroment.
    Then run the ant command in the build folder to build the entire project.
    There are also IntelliJ IDEA project files included to make editing and testing the Java and Actionscript easier.

    Special Thanks


    Special thanks to the StickSports ANEs for the initial build script and testing code and the ANEZipFileproject for the FRETypeUtils code for iOS.










    相关链接:




    https://github.com/DigitalStrawberry/ANE-Bugsnag


    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有帐号?立即注册

    x
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
    收藏收藏 分享分享 支持支持 反对反对 微信
    守望者AIR技术交流社区(www.airmyth.com)
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    
    关闭

    站长推荐上一条 /4 下一条

    QQ|手机版|Archiver|网站地图|小黑屋|守望者 ( 京ICP备14061876号

    GMT+8, 2024-4-19 21:54 , Processed in 0.044531 second(s), 33 queries .

    守望者AIR

    守望者AIR技术交流社区

    本站成立于 2014年12月31日

    快速回复 返回顶部 返回列表