Skip to content

Commit b5dc98f

Browse files
committed
add option to Auto-fetch Android ID
1 parent dfa6148 commit b5dc98f

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

Editor/BugfenderCustomEditor.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public class BugfenderCustomEditor : Editor
99
private SerializedProperty m_EnableUIEventLogging;
1010
private SerializedProperty m_EnableCrashReporting;
1111
private SerializedProperty m_HideDeviceName;
12+
private SerializedProperty m_AutoAndroidID;
1213
private SerializedProperty m_PrintToConsole;
1314
private SerializedProperty m_ApiURL;
1415
private SerializedProperty m_BaseURL;
@@ -21,6 +22,7 @@ void OnEnable()
2122
m_EnableUIEventLogging = serializedObject.FindProperty("ENABLE_UI_EVENT_LOGGING");
2223
m_EnableCrashReporting = serializedObject.FindProperty("ENABLE_CRASH_REPORTING");
2324
m_HideDeviceName = serializedObject.FindProperty("HIDE_DEVICE_NAME");
25+
m_AutoAndroidID = serializedObject.FindProperty("AUTO_ANDROID_ID");
2426
m_PrintToConsole = serializedObject.FindProperty("PRINT_TO_CONSOLE");
2527
m_ApiURL = serializedObject.FindProperty("API_URL");
2628
m_BaseURL = serializedObject.FindProperty("BASE_URL");
@@ -44,6 +46,7 @@ public override void OnInspectorGUI()
4446
EditorGUILayout.PropertyField(m_EnableUIEventLogging, new GUIContent("Enable UI Event Logging"));
4547
EditorGUILayout.PropertyField(m_EnableCrashReporting, new GUIContent("Enable Crash Reporting"));
4648
EditorGUILayout.PropertyField(m_HideDeviceName, new GUIContent("Hide device name"));
49+
EditorGUILayout.PropertyField(m_AutoAndroidID, new GUIContent("Auto-fetch Android ID"));
4750
EditorGUILayout.PropertyField(m_PrintToConsole, new GUIContent("Print to console"));
4851
EditorGUILayout.PropertyField(m_ApiURL, new GUIContent("API URL (optional)"));
4952
EditorGUILayout.PropertyField(m_BaseURL, new GUIContent("Base URL (optional)"));
@@ -58,11 +61,11 @@ public override void OnInspectorGUI()
5861
EditorGUILayout.SelectableLabel("Utils.ForceCrash(ForcedCrashCategory.Abort);");
5962
if (GUILayout.Button("Documentation", GUILayout.ExpandWidth(true)))
6063
{
61-
Application.OpenURL("https://support.bugfender.com/en/articles/118148-can-i-use-bugfender-with-unity");
64+
Application.OpenURL("https://docs.bugfender.com/docs/platforms/hybrid-platforms/bugfender-for-unity");
6265
}
6366

6467
serializedObject.ApplyModifiedProperties();
65-
//Repaint(); // uncomment while editing this file
68+
Repaint(); // uncomment while editing this file
6669
}
6770

6871
}

Editor/IOSProjectBuildCustomizer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static void OnPostprocessBuild(BuildTarget buildTarget, string pathToBuil
2525
string packageGuid = pbxProject.AddRemotePackageReferenceAtVersionUpToNextMajor("https://github.com/bugfender/BugfenderSDK-iOS", "2.0.0");
2626

2727
// Add the Remote Package to the Xcode project
28-
pbxProject.AddRemotePackageFrameworkToProject(pbxProject.GetUnityMainTargetGuid(), "BugfenderLibrary", packageGuid, false /* required dependency */);
28+
pbxProject.AddRemotePackageFrameworkToProject(pbxProject.GetUnityFrameworkTargetGuid(), "BugfenderLibrary", packageGuid, false /* required dependency */);
2929

3030
// Apply changes to the pbxproj file
3131
pbxProject.WriteToFile(projectPath);

Runtime/Bugfender.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public class Bugfender : MonoBehaviour {
88
public bool ENABLE_UI_EVENT_LOGGING = false;
99
public bool ENABLE_CRASH_REPORTING = true;
1010
public bool HIDE_DEVICE_NAME = false;
11+
public bool AUTO_ANDROID_ID = false;
1112
public bool PRINT_TO_CONSOLE = false;
1213
public string API_URL;
1314
public string BASE_URL;
@@ -80,7 +81,7 @@ void Start()
8081
if(BASE_URL.Length > 0) {
8182
bugfender.CallStatic ("setBaseUrl", BASE_URL );
8283
}
83-
bugfender.CallStatic ("init", currentActivity, APP_KEY, PRINT_TO_CONSOLE );
84+
bugfender.CallStatic ("init", currentActivity, APP_KEY, PRINT_TO_CONSOLE, AUTO_ANDROID_ID);
8485
if(ENABLE_UI_EVENT_LOGGING) {
8586
var application = currentActivity.Call<AndroidJavaObject>("getApplication");
8687
bugfender.CallStatic ("enableUIEventLogging", application);

0 commit comments

Comments
 (0)