/* Swisscom Safe Connect Copyright (C) 2015 Swisscom This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.swisscom.safeconnect.sharing; import android.content.Context; import android.content.Intent; import com.swisscom.safeconnect.R; public class FacebookSharing extends Sharing { public final static String PACKAGE_NAME = "com.facebook.katana"; private final static String API_URL = "https://www.facebook.com/sharer.php?"; private final static String URL_CODE = "u="; public FacebookSharing(Context ctx){ super(ctx, PACKAGE_NAME); } @Override protected Intent shareWithBrowser(String text, String url) { return getBrowserIntent(API_URL+URL_CODE+url, "Facebook", R.drawable.fb); } @Override public Intent getIntent(String text, String url) { Intent intent = getSharingApp(PACKAGE_NAME, "", url, mContext); if (intent == null) { intent = shareWithBrowser("", url); } return intent; } }