avioli / uni_links

Flutter plugin for accepting incoming links.
BSD 2-Clause "Simplified" License
563 stars 303 forks source link

Deep link not working in IOS in Flutter #155

Closed MohammedHussein05 closed 2 years ago

MohammedHussein05 commented 2 years ago

Iv configure everything but it just works in android not IOS ,as I saw in the package there were permissions in the info.plist file to keep which I kept already

<key>FlutterDeepLinkingEnabled</key>
        <true />
        <key>CFBundleURLTypes</key>
        <array>
            <dict>
                <key>CFBundleTypeRole</key>
                <string>Editor</string>
                <key>CFBundleURLName</key>
                <string>smartassistrsa.page.link</string>
                <key>CFBundleURLSchemes</key>
                <array>
                    <string>customscheme</string>
                </array>
            </dict>
        </array>

And here is My configuration in Dashboard, This function is being called in initState.

Future<void> _handleInitialUri(CsaMemberResClass m) async {
print("inside _handleInitialUri");
try {
  final Uri uri = await getInitialUri();
  print("Uri is $uri");

  if (uri == null) {
    print('url is nullllllll in if');
  } else {
    final String id = uri.toString().split('?').last;

    print("id 1 is $id");
    Default.longftoast("id 1 is $id");

    globalId = id.toString();

    SharedPreferences.getInstance().then((preference) {
      preference.setString(Default.hasUri, "true");
      preference.setString(Default.uriId, globalId.toString());
    });

    Navigator.pushNamed(
      context,
      ActivationNumberOptions.routeName,
      arguments: m,
    );
  }
  if (!mounted) return;
} on PlatformException {
  // Platform messages may fail but we ignore the exception
} on FormatException {
  if (!mounted) return;
}
}
yadsbah commented 2 years ago

can you please say how did you fix it? I am facing the same issue

MohammedHussein05 commented 2 years ago

can you please say how did you fix it? I am facing the same issue

Actually after i started using uniLinks package i had'nt removed other packages of deeplink. idk what was the issue but after i removed it started working. can u mention ur problem or show ur code. Are u using same package?

yadsbah commented 2 years ago

can you please say how did you fix it? I am facing the same issue

Actually after i started using uniLinks package i had'nt removed other packages of deeplink. idk what was the issue but after i removed it started working. can u mention ur problem or show ur code. Are u using same package?

I have a similar problem with custom schema not working. The app closes instantly when Launch from a custom schema but works fine with universal URL

154

here is my info.plist

<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>com.****.****</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>dail</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>com.googleusercontent.apps........</string>
            </array>
        </dict>
    </array>
<key>FlutterDeepLinkingEnabled</key>
    <true/>
MohammedHussein05 commented 2 years ago

can you please say how did you fix it? I am facing the same issue

Actually after i started using uniLinks package i had'nt removed other packages of deeplink. idk what was the issue but after i removed it started working. can u mention ur problem or show ur code. Are u using same package?

I have a similar problem with custom schema not working. The app closes instantly when Launch from a custom schema but works fine with universal URL

154

here is my info.plist

<key>CFBundleURLTypes</key>
  <array>
      <dict>
          <key>CFBundleTypeRole</key>
          <string>Editor</string>
          <key>CFBundleURLName</key>
          <string>com.****.****</string>
          <key>CFBundleURLSchemes</key>
          <array>
              <string>dail</string>
          </array>
      </dict>
      <dict>
          <key>CFBundleTypeRole</key>
          <string>Editor</string>
          <key>CFBundleURLSchemes</key>
          <array>
              <string>com.googleusercontent.apps........</string>
          </array>
      </dict>
  </array>
<key>FlutterDeepLinkingEnabled</key>
  <true/>

Iv not worked on custom links but when il be free il see this

Djihanegh commented 2 years ago

I have the same problem, i used custom schema, it works well on android but on iOS it doesnt not redirect to the app.

ShahabShahab commented 1 year ago

@Djihanegh hello I have the same problem as you on ios, can I find a solution?