Comments (9)
@JackRKelly I passed on your recommendation to our docs team
from airship-flutter.
We have two actions that handle URLs - deep link and open external url action. Open external urls are assumed to be external while deep links are internal. Do you know which one is being used? If you can provide the message HTML I could see what action is being ran.
from airship-flutter.
We are using the open external link.
<a href="uairship://run-actions?open_external_url_action=%22http%3A%2F%2Famc.film%2F2pIvfo9%22">
<span>Click Here</span>
</a>
But it seems the OS refuses to reopen the app it came from after following that link. Which again, is why we handle the navigation events in the WebView widget and explicitly search URIs for our deep link scheme.
When trying to use a "Deep Link" as opposed to a "Web Page"/external link. The button isn't clickable, I have tested this on a physical device and simulator. See the HTML for the deep link button below:
<a href="uairship://run-actions?deep_link_action=%22http%3A%2F%2Famc.film%2F2pIvfo9%22">
<span>Click Here</span>
</a>
from airship-flutter.
I am not sure why it would not be clickable? It looks the same to me. Could you remote debug the webview to see whats causing it to not be clickable?
The quickest path would be to resolve this instead of coming up with a different solution.
from airship-flutter.
I believe that was just a local issue on my end.
For our previous application, we updated a predicate for open_external_url_action
(See "Setting a predicate" here: https://docs.airship.com/platform/ios/actions/).
The code looked like:
UAirship.Shared.ActionRegistry.UpdatePredicate(predicate, "open_external_url_action");
But in the documentation for the flutter SDK, there is no actions page, as I assume it has not been implemented.
And the uairship run action deep link isn't working (it is clickable, but doesn't navigate as expected). So we are expecting a way to handle open_external_url_action
.
from airship-flutter.
The deep link action, assuming we can get that to work, should do what you want to do here. You can use it for everything and the URLs you want to open externally you can from the deep link handler. How are you implementing the deep link listener?
from airship-flutter.
We have implemented the deep link handler with the follow snippets below (with some non-critical logic removed):
class DeepLinkService {
final GetNavigationService _get;
final BitlyService _bitlyService;
final AnalyticsService _analyticsService;
final _appLinkStreamController = StreamController<AppLink?>.broadcast();
Stream<AppLink?> getAppLinkStream() => _appLinkStreamController.stream;
late StreamSubscription<Uri?> _stream;
DeepLinkService(
this._get,
this._bitlyService,
this._analyticsService,
);
Future<void> start() async {
try {
logger.info('Deep Link Service Started');
final initialUrl = await getInitialUri();
onUriReceived(initialUrl);
_stream = uriLinkStream.listen((uri) {
onUriReceived(uri);
});
} catch (e) {
logger.error('Error attempting to start DeepLink Service', exception: e);
}
}
Future<void> stop() async {
return _stream.cancel();
}
Future<void> onUriReceived(Uri? uri) async {
try {
if (uri != null) {
logger.info('Deep Link Received ${uri.toString()}');
if (uri.host != 'amc.film') {
_appLinkStreamController.sink.add(
AppLink(uri: uri),
);
return;
}
final expandedUri = await _bitlyService.expand(uri.toString());
_analyticsService.reportDeepLink(expandedUri);
//Authentication guard
final authedRouteFound = _matchAuthRoute(expandedUri);
if (authedRouteFound && AuthenticationService.user.isLoggedOut()) {
var user = await _get.toNamed(LoginPage.route());
if (user == null) {
return;
}
}
await _get.routeFromExternalUrl(expandedUri);
}
} catch (ex) {
logger.error('Error receiving deep link', exception: ex);
}
}
}
We are including it in our providers in our main app file:
List<SingleChildWidget> _providers() {
return [
ProxyProvider3<GetNavigationService, BitlyService, AnalyticsService, DeepLinkService>(
update: (_, get, bitly, analyticsService, previous) => previous ?? DeepLinkService(get, bitly, analyticsService),
dispose: (_, service) => service.stop(),
),
// Other entries hidden
];
}
And we are initializing it in the view model of our splash screen:
@override
Future<void> onLoad() async {
_deepLinkService.start();
}
Hopefully these snippets help paint the picture of our implementation. If you need more context, let me know. Thanks!
from airship-flutter.
@JackRKelly You need to register for Airship's deep links:
Airship.onDeepLink
.listen((deepLink) {
Uri uri = Uri.parse(deepLink);
onUriReceived(uri);
});
from airship-flutter.
@JackRKelly You need to register for Airship's deep links:
Airship.onDeepLink .listen((deepLink) { Uri uri = Uri.parse(deepLink); onUriReceived(uri); });
Awesome! This has fixed it. I was unaware I had to register that listener. May I recommend adding a snippet (to recommend the developer check if they have attached a listener) to the manage deep links page?
from airship-flutter.
Related Issues (20)
- Airship.activeNotifications not parsing on iOS HOT 3
- Airship.addEvent doesn't work if CustomEvent's value is null HOT 2
- iOS production key HOT 3
- Flutter 3.10.0 support HOT 1
- Airship setUserNotificationsEnabled malfunction on Android HOT 1
- iOS push messages in foreground not working HOT 6
- iOS app icon badge behaves inconsistently HOT 1
- Android device debug issue HOT 5
- Android notifications are not displayed as Heads-up notifications HOT 2
- Airship.push.iOS.resetBadge is not calling the correct method name HOT 2
- Calling Airship.push.iOS.resetBadge crashes the app HOT 1
- Airship.messageCenter.onDisplay not parsing DisplayMessageCenterEvent properly HOT 2
- Crash on launch when using FlutterEngineGroup HOT 3
- Not able to get a push notification on my iOS device from a TEST Airship project HOT 5
- Push Icon Not Appearing in Android Release Build HOT 4
- Android: App is started by push message from terminated state HOT 2
- How to send a push notification prompt to a user and access the value in code on Android? HOT 5
- onPushReceived does run in background or terminated state in Iphone HOT 14
- iOS AirshipServiceExtension Example
- Push registration failed - Android HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from airship-flutter.