Io Branch Sdk Android Library


Missing Class Warnings In R8 Shrinker

Android Jetpack: Whats new in Android Support Library (Google I/O 2018)

R8 more precisely andconsistently handles missing classes and the -dontwarn option. Therefore, youshould start to evaluate the missing class warnings emitted by R8.

When R8 encounters a class reference that is not defined in your app or one ofits dependencies, it will emit a warning that appears in your build output.For example:

R8: Missing class: java.lang.instrument.ClassFileTransformer

This warning means that the class definition java.lang.instrument.ClassFileTransformercould not be found when analyzing your appâs code. While this usually means there is an error,itâs possible that you may want to ignore this warning. Two common reasons to ignore the warning are:

  • Libraries that are targeting the JVM and the missing class are of JVM library type .

  • One of your dependencies uses a compile-time only API.

  • You can ignore a missing class warning by adding a -dontwarn rule to file. For example:

    -dontwarn java.lang.instrument.ClassFileTransformer

    For convenience, AGP will generate a file that contains all potentially missingrules, writing them to a file path such as the following:app/build/outputs/mapping/release/missing_rules.txt. Add the rules to file to ignore warnings.

    Important Migration To V145

    Branch uses Facebook’s App Links metatags automatically to provide the best linking from the Facebook platform. Unfortunately, Facebook changed the way they handle App Links routing in the latest update on April 8ish.

    Two important things to do in order to properly handle deep links from Facebook

  • Make sure to update the Manifest so that the Activity with the intent filter for your URI scheme has launchMode:singleTask. See example here

  • Make sure to add this snippet of code to the Activity registered as singleTask.

  • Update the SDK to v1.4.5 or higher
  • Formatting Order Completed Events

    Segments Android library provides several helper methods so you can easily construct both properties objects and products lists so your Order Completed events conform to the Segment ecommerce specification. Heres a code example: // initialize a new properties objectPropertiesproperties=newProperties // add orderId and revenue to the properties objectproperties.putValue.putValue // initialize a new productProductproduct1=newProduct // initialize a second productProductproduct2=newProduct // add products to the properties objectproperties.putProducts // pass the properties object into your Order Completed eventAnalytics.with.track initialize a new properties objectvalproperties=Properties // add orderId and revenue to the properties objectproperties.putValue.putValue// initialize a new productProductproduct1=Product// initialize a second productProductproduct2=Product// add products to the properties objectproperties.putProducts// pass the properties object into your Order Completed eventAnalytics.with.track

    Find details on best practices in event naming as well as the Track method payload in the .

    You May Like: How To Listen To Mp3 Audiobooks On Android

    Migrating From V2 To V3

    Version 3 deprecated in favor of Version 4

    See the .

    If you are already using version 2 of the Android SDK, youll have to make few changes to get up and running with version 3.

    In version 3, weve organized the destinations to be make the core SDK even leaner and smaller. This is what the old set up looked like:

    In the new version, instead of adding the destinations directly, simply add the Segment destination modules as a dependency instead. This also ensures that the version of the Device-mode destination youre using matches the one we depend on.

    compile// Add other dependencies as you want herecompilecompilecompile

    Earlier, you could control the debugging behaviour with a boolean flag. In version 3, this is replaced by the more powerful Enum, that lets you not only control the logging behavior of the Analytics-Android SDK, but also for Device-mode destinations.

    Version 2 of the SDK also let you customize the behaviour of the SDK by providing resource values in XML. Version 3 ignores these custom options from XML to simplify behaviour and improve performance. The recommended way to customize the Analytics client is to use the methods instead.

    Behavior Change For Gradleproperties Files

    ÐÑ?полÑзÑем в Ñ?Ð²Ð¾Ð¸Ñ Ð¿ÑиложениÑ?Ñ

    Starting in AGP 4.2, it is no longer possible to override Gradle propertiesfrom subprojects. In other words, if you declare a property in file in a subproject instead of the root project, it willbe ignored.

    As an example, in previous releases, AGP would read values fromprojectDir/,projectDir/app/,projectDir/library/, etc. For appmodules, if the same Gradle property was present in bothprojectDir/ andprojectDir/app/, the value fromprojectDir/app/ would take precedence.

    In AGP 4.2, this behavior has been changed, and AGP won’t load values in subprojects . This changereflects the new Gradle behaviorand supports configuration caching.

    For more information on setting values in files, see theGradle docs.

    You May Like: Parental Control App For Android And Iphone Free

    Lint Block Semantic Change

    All lint methods that override the given severity level of an issueâenable,disable/ignore, informational, warning, error, fatalânow respect theorder of configuration. For example, setting an issue as fatal infinalizeDslnow overrides disabling it in the main DSL. For more information, see thelintblock reference docs andAndroid build flow and extension points.

    Enable Or Disable User Tracking

    In order to comply with tracking requirements, you can disable tracking at the SDK level. Simply call:


    This will prevent any Branch requests from being sent across the network, except for the case of deep linking. If someone clicks a Branch link, but has expressed not to be tracked, we will return deep linking data back to the client but without tracking information captured.

    In do-not-track mode, you will still be able to create and share links. They will not have identifiable information. Event tracking wonât pass data back to the server if a user has expressed to not be tracked. You can change this behavior at any time, but calling the above function. This information will be saved and persisted.

    Also Check: Most Popular Word Games For Android

    Whats A Referring User

    If this is the first time youve heard about referral programs, there might be some ambiguity in the terms listed above. To help clear that ambiguity, Ive provided definitions to terms that one should get acquainted with:

  • Referring user A user whose content brings a new or existing user into the app. Youll want to make sure that these users get taken care of by giving them the highest tier of rewards in your app. This could be money, coupons or a status upgrade, etc.
  • Referred user A user who installs/opens the app via the influence of a referring users content.
  • Referral rule A rule that dictates by how much a user type should get credited when they trigger an event.
  • Event An action that any user takes inside the app such as signing up for an account.
  • Referred event An action that a referred user takes inside the app.
  • An in-app unit or currency specific to your app.
  • Deep link A route to a particular piece of content in your app.
  • Referral link A deep link created by a referring user.
  • Onboarding flow A set of screens that new users are greeted with the first time they install the app.
  • Now that you know what to look for in a referral program and are familiar with the vocabulary related to it, its time to cover the steps for launch. Heres a quote from one of our partners who uses our referral links to drive adoption:

    How to Launch a Credit Referral Program in 6 steps:By the end of this guide, your users will be able to:

  • Allow users to share links.
  • Queue Persistance In Analytics

    What’s new in Android Support Library (Google I/O ’17)

    Analytics-Android uses a persistent disk queue, so the events persist even when the app is killed. On app restart, the library reads them from disk and uploads the events. The queue works on top of Tape, which is designed to even survive process and system crashes.

    Analytics-Android saves up to 1000 calls on disk, and these never expire.

    Recommended Reading: Best Free New Movie App For Android

    Configuring The Android Install Referrer

    In order to configure your app to receive the Android install referrer, you must register your application to receive the broadcast. Insert the following in between the < application /> tags in your manifest.

    In this case, io.branch.testbed.InstallListener is the name of your custom class that will receive the broadcasts. This is a simple subclass of BroadcastReceiver. Heres the boilerplate code that youll need for this class:

    Register User Actions On An Object

    This functionality is deprecated. Please consider using BranchEvent for tracking user action and events as described here.

    We’ve added a series of custom events that you’ll want to start tracking for rich analytics and targeting. Here’s a list below with a sample snippet that calls the register view event.

    Same as above but for Blackberry Store
    “$windows_phone_url”Same as above but for Windows Store

    You have the ability to control the direct deep linking of each link by inserting the following optional keys in the control params:

    “$deeplink_path”The value of the deep link path that you’d like us to append to your URI. For example, you could specify “$deeplink_path”: “radio/station/456” and we’ll open the app with the URI “yourapp://radio/station/456?link_click_id=branch-identifier”. This is primarily for supporting legacy deep linking infrastructure.
    “$always_deeplink”true or false. This key can be specified to have our linking service force try to open the app, even if we’re not sure the user has the app installed. If the app is not installed, we fall back to the respective app store or $platform_url key. By default, we only open the app if we’ve seen a user initiate a session in your app from a Branch link

    Then, make a request to the Universal Object in order to create the URL.

    branchUniversalObject.generateShortUrl     }}) 

    Don’t Miss: Best Porn Blocking App For Android

    Proguard Settings For Leveraging Branch’s Pooled Matching

    To collect the Google Advertising ID, you must ensure that proguard doesn’t remove the necessary Google Ads class. The surest way to do this is add it to your proguard rules. If your Application is enabled with proguard, add the following instruction to your proguard.cfg or file:

    -keep class** 

    In case you are using Facebook SDK to support deep linking through Facebook ads, please make sure to keep the Facebook SDK classes in proguard

    -keep class com.facebook.applinks.** -keepclassmembers class com.facebook.applinks.** -keep class com.facebook.FacebookSdk 

    If you are adding support for Huawei devices without Google Mobile Services, please make sure to add this to your proguard rules.

    -keep class** -keep interface** 

    Add Your Branch Key To Your Project

    Deep linking in Android â Part 2. Hey guys, this tutorial ...

    After you register your app, your Branch key can be retrieved on the Settings page of the dashboard. Add it to your project’s manifest file as a meta data.

    Edit your manifest file to have the above items

    < manifest xmlns:android=""    package="io.branch.sample"    android:versionCode="1"    android:versionName="1.0"> < uses-permission android:name="android.permission.INTERNET" /> < application> < !-- Other existing entries --> < !-- Add this meta-data below, and change "key_live_xxxxxxx" to your actual live Branch key --> < meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_xxxxxxx" /> < !-- For your test app, if you have one  Again, use your actual test Branch key --> < meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_yyyyyyy" /> < /application> < /manifest> 

    You May Like: Best Vpn For Sony Android Tv

    Sending Data To Destinations

    There are two ways to send data to your analytics services through this library:

  • Through the Segment servers, also known as cloud-mode
  • Directly from the users device using bundled SDKs
  • Note: Refer to the specific destinations docs to see if your tool must be bundled in the app or sent server-side.

    Cloud-Mode in Android

    When a destination is enabled for your Android source from the Segment web app, but you havent packaged its SDK with your app, requests go through the Segment REST API, and are routed to the destination services API as . Most, but not all destinations offer a cloud-based connection mode, so its a good idea to .

    Packaging device-mode destination SDKs

    We recommend using device-mode destinations on a need-to-use basis only, to reduce the size of your application, and to avoid running into the dreaded 65k method limit.

    To package Device-mode destinations, first add the dependencies you need to your project. You can find these in the Segment app when you open the destination for your source.


    Once you add the dependency, register the destination with the Analytics-Android SDK.

    Branch Sdk Failtrouble Initializing Branch

    I’m using branch io version 4.2.0

    Sometime i’m able to generate that share link, but sometime its not work properly. Branch IO SDK behaviours is weird.


    I/BranchSDK: Http connect exception: SSL handshake aborted: ssl=0x7bcb89b888: I/O error during system call, Connection reset by peer

    BRANCH SDK FailTrouble initializing Branch. Branch API Error: poor network connectivity. Please try again later.

    I/BranchSDK: Branch Error: User session has not been initialized!

    In most of the cases this happens when you are using wrong branch keys, please verify this by going to Branch Dashboard -> Account Settings -> Branch Key and compare it with your Manifest file Branch Key. Please refer this for more details:

    Test your Branch Integration by calling IntegrationValidator.validate in your MainActivity’s onStart. Check your ADB Logcat to make sure all the SDK Integration tests pass. Make sure to comment out or remove IntegrationValidator.validate in your production build.


    While tapping on the link you can set the App in debug mode and see if the data is getting updated in Branch Liveview. You can refer to this for more details. Make sure that every test passes, you can see this in the Xcode console.

    You can verify the setup with our troubleshooting documentation:

    You May Like: Program To Backup Android Phone To Computer

    Adding Device Mode Integration

    Depending on the platform of integration follow the steps below to integrate with Device-mode.

    • Open the Podfile of your project and add the following line
    • Finally change the SDK initialization with the following
      CopyRudderConfigBuilder *builder = init] ] 

    version 5.0 or higher

    Once confirmed, follow these steps to add Branch to your Android project:

    • Open your app/build.gradle file, add the following
    • Add the following under dependencies section
    • Finally change the initialization of the SDK with the following

    Now follow the instructions below to send events to Branch.

    If Using Bnclt Or A Custom Domain

    Building AR apps with the Sceneform SDK (Google I/O ’18)

    You only need to know live_app_alpha_encoded_id and test_app_alpha_encoded_id which you can obtain from the Branch dash board once you enable App Linking support for your application.

    < activity android:name="com.yourapp.your_activity"> < !-- App Link your activity to Branch links--> < intent-filter android:autoVerify="true"> < action android:name="android.intent.action.VIEW" /> < category android:name="android.intent.category.DEFAULT" /> < category android:name="android.intent.category.BROWSABLE" /> < data android:scheme="https" android:host="" android:pathPrefix="/live_app_alpha_encoded_id" /> < !-- live_app_alpha_encoded_id can be obtained from the Branch Dashboard here: --> < data android:scheme="https" android:host="" android:pathPrefix="/test_app_alpha_encoded_id" /> < !-- test_app_alpha_encoded_id can be obtained from the Branch Dashboard here: --> < !-- If you set up a white label for your links in your Branch link settings then  only need to add the white label domain --> < data android:scheme="https" android:host=""/> < /intent-filter> < /activity> 

    That’s all you need. Deep linked parameters associated with the link is passed through Branch initialization process.

    Note: While using App Links please make sure you have registered the Activity for deep linking using Branch URI scheme as discussed in the previous session inorder to get deep link work on previous versions of Android.

    Read Also: Android App Security Best Practices

    Addition Of Native Libraries In A Java Resources Folder Is Not Supported

    Previously, you could add a native library in a Java resources folder, andregister the folder using android.sourceSets.main.resources.srcDirsso thatthe native library would be extracted and added to the final APK. Starting withAGP 7.0, this is not supported and native libraries in a Java resourcesfolder are ignored. Instead, use the DSL method intended for nativelibraries, android.sourceSets.main.jniLibs.srcDirs. For more information, seehow to configure source sets.

    What Is Android App Link

    An Android App Link is a deep link based on your website URL that has been verified to belong to your website. So click one of these immediately opens your app if its installed the disambiguation dialog does not appear. Though the user may later change their preference for handling these links. Users following links on devices have one goal in mind: to get to the content they want to see. As a developer, you can set up Android App Links to take users to a links specific content directly in your app, bypassing the app-selection dialog, also known as the disambiguation dialog. Because Android App Links leverage HTTP URLs and association with a website, users who dont have your app installed go directly to content on your site.

    Also Check: The Best Vpn For Android

    Use Java 11 Source Code In Your Project

    You can now compile up to Java 11 source code in your appâs project, enablingyou to use newer language features like private interface methods, the diamondoperator for anonymous classes, and local variable syntax for lambda parameters.

    To enable this feature, set compileOptions to the desired Java version andset compileSdkVersion to 30 or above:

    Tracking User Actions And Events

    Deep linking in Android â Part 2. Hey guys, this tutorial ...

    Use BranchEvent class to track special user actions or application specific events beyond app installs, opens, and sharing. You can track events such as when a user adds an item to an on-line shopping cart, or searches for a keyword etc.BranchEvent provides an interface to add content represented by a BranchUniversalObject in order to associate content with events.You can view analytics for the BranchEvents you fire on the Branch dashboard. BranchEvents provide a seamless integration with many third party analytics providers like Google Analytics, Criteo.BRANCH_STANDARD_EVENT enumerate the most commonly tracked events and event parameters that can be used with BranchEvent for the best results. You can always use custom event names and event parameters.

    new BranchEvent    .setAffiliation    .setCoupon    .setCurrency    .setTax    .setRevenue    .setDescription    .setSearchQuery    .addCustomDataProperty    .addContentItems    .logEvent 
    new BranchEvent    .addCustomDataProperty    .addCustomDataProperty    .logEvent 

    Recommended Reading: Best Free Dash Cam App For Android

    Branchio Deferred Deep Link Missing Data After Install

    I’m trying to get deferred deep links working on Android. I added a test device in the dashboard & reset the device data and made sure the app is uninstalled. When I click a link, it takes me to the play store as expected. I then launch the app from Android Studio onto the phone, then the logs say that Branch SDK sent a request to, but the problem is the response doesn’t contain the original link, query params, or key value pairs I set in the dashboard. This is the JSONObject I’m receiving in onInitFinished:

    Where is all the other information? This doesn’t include the original link, the key-value pairs, tags, etc.

    For a comparison, this is what I receive in the iOS app:

    , "~campaign": "test"]

    If I rotate the phone to recreate the Activity or reopen the app a single time, it then sends a request to and returns all the info I expected initially. How do I get the information after installing the app?

    I’m currently testing with, and I call Branch.enableTestMode before Branch.getAutoInstance in my custom Application class’s onCreate. I also tried with a live link and got the same result.

    These are the libraries I’m using in build.grade:

    implementation ''implementation ''implementation ''implementation 'androidx.browser:browser:1.3.0'

    Share post:


    More like this

    Sign Documents On Android Phone

    How To...

    What Is Digital Secure App On Android

    Best Password...

    How To Develop An App For Android Free

    Android App...

    How To Create Resume On Android Phone

    Build Free...