Summary
Add deep linking capability to handle payment URIs and direct links for seamless transaction initiation.
What is Deep Linking?
Allows opening the wallet directly to specific functionality (like send screen) with pre-filled data via custom URIs.
Current State
- No deep linking support
- Cannot handle
peercoin: URIs from external sources
- No integration with web/mobile payment flows
Benefits
- One-click payments from emails/websites/forms
- Support for standard crypto URI schemes (
peercoin:address?amount=X)
- Better integration
Implementation
Platform Setup
Android (AndroidManifest.xml):
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="peercoin" />
</intent-filter>
iOS (Info.plist):
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array><string>peercoin</string></array>
</dict>
</array>
Flutter Code
Main Entry (main.dart):
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initial URI handling
final initialUri = await getInitialUri();
if (initialUri != null) handleDeepLink(initialUri);
// Runtime URI handling
uriLinkStream.listen((uri) => uri != null ? handleDeepLink(uri) : null);
runApp(MyApp());
}
void handleDeepLink(Uri uri) {
if (uri.scheme == 'peercoin') {
// Extract address, amount, label from URI
// Navigate to send screen with pre-filled data
}
}
Supported URI Formats
- Custom Scheme:
peercoin://pay?address=...&amount=X&label=Y
- Standard BIP-21:
peercoin:address?amount=X&label=Y
Parameters
address (required): Recipient address
amount (optional): Payment amount
label (optional): Description
message (optional): Additional info
Testing
- Test URI handling from emails, browsers, other apps
- Validate error handling for invalid inputs
Summary
Add deep linking capability to handle payment URIs and direct links for seamless transaction initiation.
What is Deep Linking?
Allows opening the wallet directly to specific functionality (like send screen) with pre-filled data via custom URIs.
Current State
peercoin:URIs from external sourcesBenefits
peercoin:address?amount=X)Implementation
Platform Setup
Android (
AndroidManifest.xml):iOS (
Info.plist):Flutter Code
Main Entry (
main.dart):Supported URI Formats
peercoin://pay?address=...&amount=X&label=Ypeercoin:address?amount=X&label=YParameters
address(required): Recipient addressamount(optional): Payment amountlabel(optional): Descriptionmessage(optional): Additional infoTesting