Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When click on notification app doesn't start #4

Closed
kashiflab opened this issue Jul 26, 2023 · 4 comments
Closed

When click on notification app doesn't start #4

kashiflab opened this issue Jul 26, 2023 · 4 comments

Comments

@kashiflab
Copy link

No description provided.

@HarshAndroid
Copy link
Owner

Actually that notification is just for showing vpn connection details. If you want to handle click on it then you need to modify notification codes in java (vpn library created by Nizwar and we imported).

File that contains notification codes: https://github.com/HarshAndroid/FreeVPN-App-Flutter/blob/master/android/vpnLib/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java

@kashiflab
Copy link
Author

I tried to call mainactivity intent but it's not working even though I checked the flags as well.
Can you please tell me, how can I achieve this? @HarshAndroid

@HarshAndroid
Copy link
Owner

Actually I don't know much of Java but there is something call PendingIntent in Java. You need to create it & then pass as argument in notification while creating it.

Example Codes:
//Sample code to create pending intent
PendingIntent contentIntent = new PendingIntent.getActivity(this, 0, intent, flag);
(You need to research about flag parameter a bit).

//for adding to notification before build
.setContentIntent(contentIntent)

@kashiflab
Copy link
Author

that's what i actually did but MainActivity is not present in the lib and need to pass it as a module. thanks for you help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants