Known Issues

On this page, we will list known issues with Photon on the various platforms. The focus here is on issues which we can't fix or workaround. In some cases, this means we will simply list broken versions per platform and guide you to other versions.

Mobile Background Apps

On mobile platforms, if the app moves to background it pauses the main message loop which is responsible for keeping the client connected among other things.

Typical causes of this are:

  • Player hits "home button".
  • Phone call received.
  • Video ads.
  • Third party plugin that introduces an overlay view in the app (e.g. facebook, Google, etc.).

If the app stays paused for more than the client disconnect timeout (which should be 10 seconds by default) the client will be disconnected and you need to reconnect as soon as the app is "unpaused". A "timeout disconnect" callback will be triggered only when the app is no longer in the background.

If the game design can allow a player to return even after several seconds or minutes, then you could also reconnect and rejoin the game again. If you want to rejoin the same room with same actor number when the app is unpaused you need to take few things into consideration:

  • PlayerTTL: the room needs to be created with a PlayerTTL value high enough that permits a player to return after a while.
  • EmptyRoomTTL: the room needs to be created with an EmptyRoomTTL value high enough to keep the room alive for a while when the last joined player's app is in the background.

Unity

RunInBackground

Unity's Application.runInBackground is not supported on mobile platforms. Instead, the OnApplicationPause method is called whenever the app moves to or back from background:

void OnApplicationPause( bool pauseStatus )
{
    if (pauseStatus)
    {
        // app moved to background
    } else
    {
        // app is foreground again
    }
}

Windows Store Capabilities

If you target Windows Store (UWP) and you are having exceptions when you try to connect or you have this error:

A network capability is required to access this network resource

Make sure to enable the required capability from Unity's "Player Settings" -> "Publisher Settings" -> "Capabilities -> "InternetClient"

Required Capability for Windows Store Apps
Required Capability for Windows Store Apps. You also need the 'Microphone' capability, if you use Photon Voice.

UWP Exports

If you want to export your Unity application to UWP you can either use .NET or IL2CPP as scripting backend. Photon PUN is already configured to choose the correct library in order to successfully export the application from Unity. If however something goes wrong while exporting please check and make sure that you are using the correct library for the certain scripting backend:

If you are using .NET as scripting backend make sure that Photon3Unity3D.dll is used from /Assets/Plugins/Metro/ directory

If you are using IL2CPP as scripting backend make sure that Photon3Unity3D.dll is used from /Assets/Plugins/ directory

iOS IPv6

While Unity 5.x should support IPv6 on iOS in general, some versions (like 5.4) break this feature. Some of the supported versions are: 4.7.2, 5.1.5, 5.2.5, 5.3.4p4, 5.4.0p1 and newer (see Unity blog post).

Photon Voice

Android 6.0 Permissions

Requesting Android permissions was added in Unity 2018.3. You can read about it here where you can find an example of how to request Microphone permission.

Usually when building for Android platform, most permissions will be added automatically by Unity to the manifest file. The two permissions required by Photon Voice are:

  • android.permission.INTERNET: automatically added via Unity's Player Settings.
  • android.permission.RECORD_AUDIO: automatically added when Unity's microphone API is used.

However, with Android Marshmallow there seems to be a problem due to the newly introduced permissions model. The generated APK will be missing android.permission.RECORD_AUDIO permission and the application will not be able to record your voice. To avoid such issue please update to the latest Unity version when targeting Android SDK level 23.

Unity's default behaviour asks for all permissions as soon as the application is opened. You can disable this by adding a line to the "AndroidManifest.xml" file:

If you do so, you need to request the microphone permission by yourself. Otherwise Photon Voice will not work. You could make use of this plugin.

iOS 10 Requirement

You need to add a "Microphone Usage Description" to your project's "Player Settings" under "Other Settings" -> "Configuration" section as shown in the screenshot below:

Microphone Usage Description in Player Settings for iOS
Microphone Usage Description in Player Settings for iOS.

Alternatively, you must add a NSMicrophoneUsageDescription key to "Info.plist" in Xcode project exported by Unity. The string value should explain why your application uses microphone. Failure to do so may result in:

  • Rejection of build submission by Apple.
  • Crashes.

Unity Microphone Issues

In some Unity versions Microphone.Start() may throw a null pointer exception or return 0 channels. The latter may result in the following exception:

ArgumentOutOfRangeException: Must be Mono or Stereo

Also in some cases, the reported sample rate may be 0 from the microphone clip.

To know if the Unity version you are using has such issues you can check this Unity issue tracker link.

Also for some Unity versions input device switching is broken on Windows. For more information check out this Unity issue tracker link.

Frequency Warnings

In case you encountered a warning similar to this one:

MicWrapper does not support suggested frequency 48000 (min: 44100, max: 44100). Setting to 44100

It means that the sampling rate set can't be used due to hardware limitations.

Local voice #1 audio source frequency 44100 and encoder sampling rate 24000 do not match. Resampling will occur before encoding.

This other warning is about resampling (affecting performance in theory) which occurs when microphone frequency does not match encoder frequency. It's a good practice to set microphone frequency exactly the same to the encoder's whenever possible.

Opus encoder supports few fixed frequencies for incoming signal. You should choose them when create local voice. It does not make sense to feed local voice with data of different frequency. So, when you set up capture device, you set the same frequency for it. However, some devices do not allow arbitrary frequencies (e.g. Android). The closest available and supported frequency is set in this case.

Native Library Updates

Unity Editor Warning For Native Library Files
Unity Editor Warning For Native Library Files.

If a native library file is loaded using code when in play mode inside the Unity Editor it will not be unloaded unless you close the Editor. Unity Editor will throw an error (see screenshot below) when you try to import and update a native library file if the latter is already loaded in memory because you entered play mode at least once. Even if you manually delete it while the Editor is still open the issue persists whether you do it from within or outside the Editor itself. So make sure you restart the Unity Editor when updating Photon Voice and do not enter play mode before doing the update.

Unity Editor Native Library Import Error
Unity Editor Native Library Import Error.

Android 64-bit Support

Photon Voice provides Android 64-bit compatible libraries starting from versions 1.18 and 2.4. Minimum supported Unity versions are 2017.4 LTS and 2018.2. For the full list of Unity versions that support Android 64-bit and instructions go to this link.

iOS Speaker Issue

Unity has a known issue with iOS (mostly iPhone) where the "ear speaker" (the one on the top of the front of the device used for phone calls) is used as default audio output device instead of the loud speaker (also called internal speaker) or any other plugged or connected headphones, headset or earpieces.

This issue is also sometimes referred to as "low volume".

Link to the Unity Issue Tracker.

To address this issue we recommend the following:

  1. If you are using Photon Voice 1 upgrade to Photon Voice 2.
  2. Use Photon as Recorder.MicrophoneType.
  3. If 1 and 2 are not possible:
    a. If you use Unity 2018.3 or newer, you can enable "Force iOS Speakers when Recording" from iOS Player Settings.
    b. Photon Voice already include the "UnitySpeakerFix". Add IOSAudioForceToSpeaker component to the same GameObject to the Recorder.

 To Document Top