Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright 2010-present Facebook.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook;
import android.net.Uri;
import android.os.Bundle;
import bolts.AppLink;
import bolts.AppLinkResolver;
import bolts.Continuation;
import bolts.Task;
import com.facebook.model.GraphObject;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
/**
* Provides an implementation for the {@link AppLinkResolver AppLinkResolver} interface that uses the Facebook App Link
* index to solve App Links, given a Url. It also provides an additional helper method that can resolve multiple App
* Links in a single call.
*/
public class FacebookAppLinkResolver implements AppLinkResolver {
private static final String APP_LINK_KEY = "app_links";
private static final String APP_LINK_ANDROID_TARGET_KEY = "android";
private static final String APP_LINK_WEB_TARGET_KEY = "web";
private static final String APP_LINK_TARGET_PACKAGE_KEY = "package";
private static final String APP_LINK_TARGET_CLASS_KEY = "class";
private static final String APP_LINK_TARGET_APP_NAME_KEY = "app_name";
private static final String APP_LINK_TARGET_URL_KEY = "url";
private static final String APP_LINK_TARGET_SHOULD_FALLBACK_KEY = "should_fallback";
private final HashMap cachedAppLinks = new HashMap();
/**
* Asynchronously resolves App Link data for the passed in Uri
*
* @param uri Uri to be resolved into an App Link
* @return A Task that, when successful, will return an AppLink for the passed in Uri. This may be null if no App
* Link data was found for this Uri.
* In the case of general server errors, the task will be completed with the corresponding error.
*/
public Task getAppLinkFromUrlInBackground(final Uri uri) {
ArrayList uris = new ArrayList();
uris.add(uri);
Task