Closed dariyanto closed 4 years ago
Hello!
You need to register
still won't work
AndroidManifest.xml
<activity
android:name=".vpn.activity.MainActivity"
android:exported="true" >
<intent-filter>
<action android:name="com.example.ACTION_MAIN" />
</intent-filter>
</activity>
MyApplication.java
public class MyApplication extends Application {
private static final String CHANNEL_ID = "my_vpn";
static final String ACTION_MAIN = "com.example.ACTION_MAIN";
@Override
public void onCreate() {
super.onCreate();
initHydraSdk();
}
public void initHydraSdk() {
createNotificationChannel();
SharedPreferences prefs = getPrefs();
ClientInfo clientInfo = ClientInfo.newBuilder()
.baseUrl(BuildConfig.BASE_HOST)
.carrierId(BuildConfig.BASE_CARRIER_ID)
.build();
NotificationConfig notificationConfig = NotificationConfig.newBuilder()
.title(getResources().getString(R.string.app_name))
.clickAction(ACTION_MAIN)
.inConnected("Connected","Connected to our server")
.inConnecting("Connecting...","Connecting to our server")
.smallIconId(R.drawable.ic_notification)
.channelId(CHANNEL_ID)
.build();
HydraSdk.setLoggingLevel(Log.VERBOSE);
HydraSDKConfig config = HydraSDKConfig.newBuilder()
.observeNetworkChanges(true)
.captivePortal(true)
.moveToIdleOnPause(false)
.build();
HydraSdk.init(this, clientInfo, notificationConfig, config);
}
//rest of code
}
Add category to your intent-filter `
`
How to start specific activity from notification ? the documentation is unclear, please provide example