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

提个建议 #3

Open
zhangruiyu opened this issue May 24, 2021 · 24 comments
Open

提个建议 #3

zhangruiyu opened this issue May 24, 2021 · 24 comments

Comments

@zhangruiyu
Copy link

目前使用applink发现应用在后台期间,通过链接打开app无法获取参数
应该再安卓onresume的时候再次去eventSink发下新数据吧,而且flutter的MainActivity应该是singleTop

@zhangruiyu
Copy link
Author

或者可以把getAppLinking时机交给开发者控制,我们可以在flutter端主动获取applinking

@Mayism
Copy link
Contributor

Mayism commented May 28, 2021

@zhangruiyu
首先非常感谢您的反馈。

当前Flutter中获取AppLinking的agcAppLinking.onResolvedData方法,在Android默认的standard启动模式下,仅需要在初始化设置一次就可以,后续热启动的时候也同样会调用设置的回调。

但是对于singleTop启动模式,插件的onResolvedData接口未对onNewIntent进行有效处理,导致singleTop模式下热启动的确会存在无法获取AppLinking的问题。

考虑到Flutter平台下,singleTop是默认的启动模式。因此,我们将对该模式下的热启动问题进行优化处理,在插件的下个版本发布。

@zhangruiyu
Copy link
Author

太好了 我刚才还在反馈这个问题,期待下个版本
image

@zhangruiyu
Copy link
Author

@zhangruiyu
首先非常感谢您的反馈。

当前Flutter中获取AppLinking的agcAppLinking.onResolvedData方法,在Android默认的standard启动模式下,仅需要在初始化设置一次就可以,后续热启动的时候也同样会调用设置的回调。

但是对于singleTop启动模式,插件的onResolvedData接口未对onNewIntent进行有效处理,导致singleTop模式下热启动的确会存在无法获取AppLinking的问题。

考虑到Flutter平台下,singleTop是默认的启动模式。因此,我们将对该模式下的热启动问题进行优化处理,在插件的下个版本发布。

请问下个版本什么时候发布呢

@zhangruiyu
Copy link
Author

已经第四季度了 请问有任何进展?

@zhangruiyu
Copy link
Author

@Mayism

@Mayism
Copy link
Contributor

Mayism commented Dec 6, 2021

@zhangruiyu 不好意思噢 版本还在开发中 暂未发布

@zhangruiyu
Copy link
Author

好家伙啊,。。有大概日期吗。太久了吧,这

@Mayism
Copy link
Contributor

Mayism commented Dec 13, 2021

@zhangruiyu 之前计划是年底 目前还不清楚哦

@zhangruiyu
Copy link
Author

已经2022年了, 之前让我们用华为的东西, 我们也用了 现在一个bug要修复1年吗 发个版本更新下这么难吗

@Mayism
Copy link
Contributor

Mayism commented Jan 25, 2022

@zhangruiyu 实在是不好意思 已经和开发再次确认了 正在评估解决方案 最快下个月出版本

@huseyinerenguler
Copy link

Hi @zhangruiyu

From what you said, I understood that the problem was:

While the application is close, when you click on the link, the application opens without any problems and the link parameters can be accessed. But while the application is open in the background, when the link is clicked, it redirects to the application, but the parameters cannot be accessed.

I completed the following 4 tests for this problem that I understood and I did not encounter the situation you mentioned.

  1. Tested with 1.2.0+300 version while app is not open.
  2. Tested with 1.2.0+300 version while app is open in background.
  3. Tested with 1.5.0+300 (null-safety) version while app is not open.
  4. Tested with 1.5.0+300 (null-safety) version while app is open in background.

Also I checked our demo application, and it works.

We released our new (null-safety) version 1.5.0+300 on January 24, 2022. Please test the following again, if the issue you mentioned still exists, give us more details.

  1. Update your flutter version to latest and test with 1.5.0+300 (null-safety) version.
  2. If not, use different devices. Maybe the issue is device specific.
  3. Check our demo application.
  4. Read the documentation again, maybe you missed something.

@zhangruiyu
Copy link
Author

Hi @zhangruiyu

From what you said, I understood that the problem was:

While the application is close, when you click on the link, the application opens without any problems and the link parameters can be accessed. But while the application is open in the background, when the link is clicked, it redirects to the application, but the parameters cannot be accessed.

I completed the following 4 tests for this problem that I understood and I did not encounter the situation you mentioned.

  1. Tested with 1.2.0+300 version while app is not open.
  2. Tested with 1.2.0+300 version while app is open in background.
  3. Tested with 1.5.0+300 (null-safety) version while app is not open.
  4. Tested with 1.5.0+300 (null-safety) version while app is open in background.

Also I checked our demo application, and it works.

We released our new (null-safety) version 1.5.0+300 on January 24, 2022. Please test the following again, if the issue you mentioned still exists, give us more details.

  1. Update your flutter version to latest and test with 1.5.0+300 (null-safety) version.
  2. If not, use different devices. Maybe the issue is device specific.
  3. Check our demo application.
  4. Read the documentation again, maybe you missed something.

I believe that the MainActivity startup mode of flutter should be Android :launchMode="singleTop ". This is the default solution of the Flutter app, but it is written Step 8: according to the documentation. This will cause multiple startup modes. Set to singleTop, this time from background to pull up the app, agcAppLinking. OnResolvedData! . Listen ((event) does not trigger.
Step 8: Android :launchMode="standard" is incorrect
我认为flutter的MainActivity启动模式应该为android:launchMode="singleTop”,这是flutter app的默认方案,但是按照文档上写成Step 8:,这样会造成启动多个. 设置成singleTop,这个时候从后台拉起app,agcAppLinking.onResolvedData!.listen((event)并不会触发.
简单来说文档上的Step 8:android:launchMode="standard" 就是错误的

@zhangruiyu
Copy link
Author

I think we should provide a method for developers to call and not listen on
我认为应该提供一个方法给开发者调用,而且不是接受监听

@huseyinerenguler
Copy link

Hi @zhangruiyu

If you don't want multiple startup and still want to fetch the parameters from the deep link, you should make these changes to your project.

  1. Change android launch mode to singleTask.
android:launchMode="singleTask”
  1. Add these changes to your main activity file.
@Override
protected void onNewIntent(@NonNull Intent intent) {
    super.onNewIntent(intent);
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    startActivity(intent);
    finish();
}

With these changes, if your application is open and in the background, when you click the link, the already opened instance will be active (not creating new app instance), and onResolvedData() listener will be triggered with parameters.

@zhangruiyu
Copy link
Author

Hi @zhangruiyu

If you don't want multiple startup and still want to fetch the parameters from the deep link, you should make these changes to your project.

  1. Change android launch mode to singleTask.
android:launchMode="singleTask”
  1. Add these changes to your main activity file.
@Override
protected void onNewIntent(@NonNull Intent intent) {
    super.onNewIntent(intent);
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    startActivity(intent);
    finish();
}

With these changes, if your application is open and in the background, when you click the link, the already opened instance will be active (not creating new app instance), and onResolvedData() listener will be triggered with parameters.

finish(); MainActivity will be turned off. I've set launchMode="singleTask"

@zhangruiyu
Copy link
Author

image
If finish is removed, there will be no callbacks while the app is in the background

@zhangruiyu
Copy link
Author

@huseyinerenguler Is there any progress

1 similar comment
@zhangruiyu
Copy link
Author

@huseyinerenguler Is there any progress

@zhangruiyu
Copy link
Author

@Mayism

@huan721 huan721 closed this as completed May 20, 2022
@zhangruiyu
Copy link
Author

什么鬼?没解决就关了?

@huan721 huan721 reopened this May 20, 2022
@huan721
Copy link
Contributor

huan721 commented Jun 10, 2022

@zhangruiyu
这个issue你还有其他疑问吗?

@zhangruiyu
Copy link
Author

按照上面说的,没法实现

@zhangruiyu
Copy link
Author

Screenshot_20220610_150838_com.github.android.jpg
上面说的就非常对了,但是@huseyinerenguler 的根本不合理

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

4 participants