Please first know what is PikPak Android SDK for Telegram.
You can use the SDK for development by following the steps below.
Send an email to dev@mypikpak.com in the following format to apply for the SDK:
Apply for PikPak Android SDK for Telegram
I have read and agreed to the PikPak Open SDK Developer Service Agreement and apply to obtain PikPak Android SDK for Telegram. My App information is as follows:
App introduction: ____
App download page address: ____
App owner contact email: ____
App package name: ____
App signature md5 hash: ____
I promise that the above information is true and correct, please review my application.
Please fill in each underlined space in the body of the email with correct and true information. Sending an email means that you fully agree with the content of the email.
It should be noted that we may simply ignore applications with obvious missing or incorrect information. Even if complete information is provided, we may reject it because the App is not suitable or does not currently require more SDK integration, or we may ask for more supplementary information.
Add other dependencies to your Telegram android project. You can refer to this. If these dependencies already exist in the project, there is no need to add them again.
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.biometric:biometric:1.1.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0-alpha02'
implementation 'androidx.core:core-splashscreen:1.0.0'
implementation 'androidx.startup:startup-runtime:1.1.1'
implementation 'com.google.android.gms:play-services-auth:20.2.0'
implementation 'com.google.android.gms:play-services-auth-api-phone:18.0.1'
implementation 'com.google.android.gms:play-services-identity:18.0.1'
implementation 'com.google.android.gms:play-services-base:18.1.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation platform 'com.google.firebase:firebase-bom:32.1.0'
implementation 'com.google.firebase:firebase-dynamic-links'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.android.play:core:1.10.0'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-crashlytics-ndk'
implementation 'com.google.firebase:firebase-perf'
implementation 'com.google.android.gms:play-services-ads-identifier:17.0.1'
implementation 'com.github.tiann:FreeReflection:3.1.0'
implementation 'com.github.bumptech.glide:glide:4.15.1'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.15.1'
implementation 'jp.wasabeef:glide-transformations:4.3.0'
implementation 'com.tencent.mars:mars-xlog:1.2.6'
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
implementation 'com.facebook.android:facebook-login:12.0.1'
implementation 'com.facebook.android:facebook-android-sdk:12.0.1'
implementation 'com.android.billingclient:billing:5.1.0'
implementation 'com.xiaomi.billingclient:billing:1.1.0'
implementation 'com.airbnb.android:lottie:6.0.0'
implementation 'io.github.scwang90:refresh-layout-kernel:2.0.5'
implementation 'io.github.scwang90:refresh-header-classics:2.0.5'
implementation 'com.meituan.android.walle:library:1.1.7'
implementation 'com.meituan.android.walle:payload_reader:1.1.7'
implementation 'com.alibaba:arouter-api:1.5.2'
implementation 'com.github.hufeiyang.Android-AppLifecycleMgr:applifecycle-api:1.0.4'
implementation 'io.github.jeremyliao:live-event-bus-x:1.8.0'
implementation 'com.yanzhenjie:sofia:1.0.5'
implementation 'com.tencent.bugly:crashreport:4.1.9.2'
implementation 'com.tencent.bugly:nativecrashreport:3.9.2'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.57'
implementation 'com.klinkerapps:link_builder:2.0.5'
implementation 'com.github.jenly1314:zxing-lite:2.4.0'
implementation 'com.tencent:mmkv:1.2.16'
implementation 'com.adjust.sdk:adjust-android:4.33.4'
implementation 'com.paypal.checkout:android-sdk:0.112.0'
implementation 'com.getkeepsafe.relinker:relinker:1.4.5'
implementation 'io.github.idisfkj:android-startup:1.1.0'
implementation 'com.github.Jay-Goo:RangeSeekBar:v3.0.0'
implementation 'io.github.knight-zxw:spwaitkiller:0.0.8'
implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:4.3'
implementation 'org.greenrobot:greendao:3.3.0'
implementation 'org.fourthline.cling:cling-core:2.1.1'
implementation 'org.fourthline.cling:cling-support:2.1.1'
implementation 'org.eclipse.jetty:jetty-server:8.1.22.v20160922'
implementation 'org.eclipse.jetty:jetty-client:8.1.22.v20160922'
implementation 'org.eclipse.jetty:jetty-servlet:8.1.22.v20160922'
implementation 'org.bouncycastle:bcprov-jdk15on:1.60'
implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.7.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
implementation 'com.aliyun.dpa:oss-android-sdk:2.9.13'
implementation 'cloud.xbase.sdk:core:2.0.1.200201'
import com.pikcloud.tgapplib.PPSDKFacade;
PPSDKFacade.addMessageToDrive(context, ...);
The required interfaces and available methods are listed in the following paragraphs.
void PPSDKFacade.attachBaseContext(android.app.Application application, TGHostInterface tgHostInterface);
Register the TGHostInterface class that needs to be implemented.
void PPSDKFacade.onCreate(android.app.Application application);
Notify the application created.
void PPSDKFacade.onTerminate(android.app.Application application);
Notify the application terminated.
void PPSDKFacade.onTrimMemory(android.app.Application application, int level);
Notify the application trimed memory.
void PPSDKFacade.onLowMemory(android.app.Application application);
Notify the application low-memory happened.
void PPSDKFacade.onConfigurationChanged(android.app.Application application, @NonNull android.content.res.Configuration newConfig);
Notify the application configuration changed.
void PPSDKFacade.onTGLogout(String tgUserId);
Notify the current Telegram account logout.
void PPSDKFacade.onTGAccountSwitch(String oldTgUserId, String newTgUserId);
Notify the current Telegram account changed.
boolean isLoggedIn();
Get whether the current user has logged in to the PikPak account
void loginByUser(Context context, String scene, LoginCallback callback)
Log in to your PikPak account. If your account has already been bound, log in directly. Otherwise, the account will be bound.
void PPSDKFacade.addMessageToDrive(android.content.Context context, TGMessageFile tgMessageFile);
Store a file from a message to PikPak cloud drive.
void PPSDKFacade.play(android.content.Context context, TGMessageFile tgMessageFile);
Play a certain file via PikPak.
void PPSDKFacade.downloadToLocal(android.content.Context context, TGMessageFile tgMessageFile);
Download a file to the device via PikPak.
void PPSDKFacade.getVipStatus(android.content.Context context, String tgUserId, PPVipStatusCallback callback);
Query whether the PikPak account bound to the current Telegram account is a PikPak premium account.
void PPSDKFacade.getFriendVipStatus(android.content.Context context, List<String> tgUserIdList, PPVipStatusListCallback callback);
Batch query whether the PikPak accounts bound to the accounts of friends of the current Telegram account are premium accounts.
void PPSDKFacade.navigateToPage(android.content.Context context, String path, Bundle param);
Opens the specified PikPak function or user interface.
TGHostInterface getTGHostInterface();
Get registered TGHostInterface class.
public interface TGHostInterface {
/**
* PikPak account Premium status has changed
* @param isVip: Whether the new status is Premium
*/
void onPPVipChange(boolean isVip);
/**
* The binding status of PikPak account and Telegram account has changed
* @param isBind: Whether it has been bound
*/
void onPPBindStatusChange(boolean isBind);
/**
* Start the specified bot
* @param botId: Specified bot id
* @param botUrl: Specified bot link URL
*/
void startBot(String botId, String botUrl);
/**
* Send a text message to the specified Bot
* @param botId: Specified bot id
* @param text: Text message to sent
*/
void sendTextToBot(String botId, String botUrl, String text);
/**
* Forward a file in a message to the specified Bot
* @param botId: Specified bot id
* @param groupId: The group id or channel id of the message
* @param messageId: message id
* @param fileId: file id
*/
void sendFileToBot(String botId, String botUrl, String groupId, String messageId, String fileId);
/**
* Forward the entire message to the specified bot
* @param botId: Specified bot id
* @param groupId: The group id or channel id of the message
* @param messageId: message id
*/
void sendMessageToBot(String botId, String botUrl, String groupId, String messageId);
/**
* Get the text of the latest messages of the specified bot
* @param botId: Specified bot id
* @param count: Messages count
* @return List of messages containing text content
*/
List<String> getBotLatestMessage(String botId, String botUrl, int count);
}
/**
* The information of a file in the message
*/
public static class TGMessageFile {
public String groupId;
public String messageId;
public String fileId;
public String mimeType;
public String text;
public String fileName;
public long fileSize;
public String fileThumbnail;
public String from;
public String fileExtensionName;
public String scene;
public String toString();
}
/**
* PikPak account premium status information
*/
public static class VipStatusBean {
public String tgUserId;
public boolean isVip;
public String expire;
}
/**
* PikPak account login callback
*/
public interface LoginCallback {
void onSuccess();
void onError(String error);
}
/**
* PikPak account premium status query callback
*/
public interface PPVipStatusCallback {
void onVipStatusCallback(int ret, String errorContent, String errorKey, VipStatusBean status);
}
/**
* PikPak account premium status batch query callback
*/
public interface PPVipStatusListCallback {
void onVipStatusCallback(int ret, String errorContent, String errorKey, List<VipStatusBean> statusList);
}