iOS Push to Talk Framework Not Working in Archive Build (Flutter)

I have developed an app using Flutter that utilizes the Push to Talk framework on iOS. The Push to Talk feature works perfectly in debug mode, but after archiving the build and installing it on an iOS 17 device, the Push to Talk functionality stops working.

Here are the steps I have already taken:

Enabled background modes. Enabled Push to Talk capabilities. Despite these settings, the issue persists in the archive build.

Has anyone else encountered this issue? What additional steps or configurations are required to get Push to Talk working in the archive build on iOS 17?

Any help or guidance would be greatly appreciated. Thank you!

Answered by DTS Engineer in 793127022

There are many reasons a feature like push to talk would work in debug mode and not in release mode. It is going to be a guessing game for us without some more information about your app, and it is possible that there could be some issues with your build settings (unfortunately we can't help with how to find and fix them in Flutter) but the most common cause of push based functionality to work in one mode and not the other is the use of wrong push tokens, or using the wrong APNs endpoint to send the pushes.

When you build an app to Archive, the aps-environment setting (entitlement) will automatically change from 'development' to 'production'. This means you now have to use the new token that the app will be assigned, and you have to use the production APNs endpoint to send the push.

Development or Production tokens can only be used in the environments they belong in. The environment a token belongs to is determined by the aps-environment entitlement. By default, Xcode will set this to 'development' for debug builds, and 'production' for release builds. So, if you run the debug version, you will get a development token, and if you run the release version, you will get a production token.

You will need to make sure that the push is being sent on the environment the token belongs in.

If this does not turn out to be the cause of your issue, you will want to check other things like build settings, your code paths based on debug/release versions, and that you have indeed been assigned the push-to-talk entitlement for release builds.

There are many reasons a feature like push to talk would work in debug mode and not in release mode. It is going to be a guessing game for us without some more information about your app, and it is possible that there could be some issues with your build settings (unfortunately we can't help with how to find and fix them in Flutter) but the most common cause of push based functionality to work in one mode and not the other is the use of wrong push tokens, or using the wrong APNs endpoint to send the pushes.

When you build an app to Archive, the aps-environment setting (entitlement) will automatically change from 'development' to 'production'. This means you now have to use the new token that the app will be assigned, and you have to use the production APNs endpoint to send the push.

Development or Production tokens can only be used in the environments they belong in. The environment a token belongs to is determined by the aps-environment entitlement. By default, Xcode will set this to 'development' for debug builds, and 'production' for release builds. So, if you run the debug version, you will get a development token, and if you run the release version, you will get a production token.

You will need to make sure that the push is being sent on the environment the token belongs in.

If this does not turn out to be the cause of your issue, you will want to check other things like build settings, your code paths based on debug/release versions, and that you have indeed been assigned the push-to-talk entitlement for release builds.

iOS Push to Talk Framework Not Working in Archive Build (Flutter)
 
 
Q