├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── codeheadlabs │ └── zendesk │ ├── ZendeskPigeon.java │ └── ZendeskPlugin.java ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── codeheadlabs │ │ │ │ └── zendesk │ │ │ │ └── MainActivityTest.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── integration_test │ └── visitor_info_test.dart ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ ├── Flutter.podspec │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.yaml └── test_driver │ └── integration_test.dart ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── ZendeskPlugin.h │ ├── ZendeskPlugin.m │ ├── zendesk.pigeon.h │ └── zendesk.pigeon.m └── zendesk.podspec ├── lib ├── src │ ├── pigeon.dart │ └── zendesk.dart └── zendesk.dart ├── pigeons └── zendesk.dart └── pubspec.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .atom/ 3 | .idea/ 4 | .vscode/ 5 | 6 | .packages 7 | .pub/ 8 | .dart_tool/ 9 | pubspec.lock 10 | flutter_export_environment.sh 11 | 12 | examples/all_plugins/pubspec.yaml 13 | 14 | Podfile 15 | Podfile.lock 16 | Pods/ 17 | .symlinks/ 18 | **/Flutter/App.framework/ 19 | **/Flutter/ephemeral/ 20 | **/Flutter/Flutter.framework/ 21 | **/Flutter/Generated.xcconfig 22 | **/Flutter/flutter_assets/ 23 | 24 | ServiceDefinitions.json 25 | xcuserdata/ 26 | **/DerivedData/ 27 | 28 | local.properties 29 | keystore.properties 30 | .gradle/ 31 | gradlew 32 | gradlew.bat 33 | gradle-wrapper.jar 34 | .flutter-plugins-dependencies 35 | *.iml 36 | 37 | generated_plugin_registrant.dart 38 | GeneratedPluginRegistrant.h 39 | GeneratedPluginRegistrant.m 40 | GeneratedPluginRegistrant.java 41 | GeneratedPluginRegistrant.swift 42 | build/ 43 | .flutter-plugins 44 | 45 | .project 46 | .classpath 47 | .settings 48 | .last_build_id 49 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 2.0.1 2 | 3 | * Remove compatibility with V1 plugin embedding 4 | * Upgrade integration_test dependency 5 | * Migrate to null safety 6 | 7 | ## 2.0.0 (20201022) 8 | 9 | * Migrate to Zendesk Chat SDK v2 10 | 11 | ## 1.0.2 (20190831) 12 | 13 | * Fix Android VisitorInfo.Builder usage to work properly 14 | 15 | ## 1.0.1 (20190607) 16 | 17 | * Add static_framework = true to podspec 18 | * Improve variable name in example app 19 | 20 | ## 1.0.0 21 | 22 | * AndroidX support 23 | * Bump java dep to 1.4.2 24 | 25 | ## 0.0.1 26 | 27 | Initial version that implements: 28 | * init 29 | * setVisitorInfo 30 | * startChat 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 CodeHead Labs, LLC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # zendesk 2 | 3 | Flutter interface for Zendesk Mobile SDK. 4 | 5 | ## Android Integration 6 | 7 | You must set a compatible theme *theme* in the `AndroidManifest.xml` file's `` tag. The details are outlined on the [zendesk forums](https://develop.zendesk.com/hc/en-us/community/posts/360043932734/comments/360011819933). 8 | 9 | The Android example of this shows the same details. 10 | 11 | ## For Developers 12 | 13 | The plugin is using [Pigeon](https://pub.dev/packages/pigeon) to generate all the interfaces needed. 14 | To modify the interfaces, edit `zendesk.dart` in the `pigeons` folder and run: 15 | 16 | ``` 17 | flutter pub run pigeon \ 18 | --input pigeons/zendesk.dart \ 19 | --dart_out lib/src/pigeon.dart \ 20 | --objc_header_out ios/Classes/zendesk.pigeon.h \ 21 | --objc_source_out ios/Classes/zendesk.pigeon.m \ 22 | --java_out ./android/src/main/java/com/codeheadlabs/zendesk/ZendeskPigeon.java \ 23 | --java_package "com.codeheadlabs.zendesk.pigeon" 24 | ``` -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.codeheadlabs.zendesk' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | jcenter() 8 | maven { url 'https://zendesk.jfrog.io/zendesk/repo' } 9 | } 10 | 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:3.6.1' 13 | } 14 | } 15 | 16 | rootProject.allprojects { 17 | repositories { 18 | google() 19 | jcenter() 20 | maven { url 'https://zendesk.jfrog.io/zendesk/repo' } 21 | } 22 | } 23 | 24 | apply plugin: 'com.android.library' 25 | 26 | android { 27 | compileSdkVersion 28 28 | 29 | defaultConfig { 30 | minSdkVersion 16 31 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 32 | } 33 | 34 | lintOptions { 35 | disable 'InvalidPackage' 36 | } 37 | 38 | compileOptions { 39 | sourceCompatibility 1.8 40 | targetCompatibility 1.8 41 | } 42 | 43 | dependencies { 44 | api group: 'com.zendesk', name: 'messaging', version: '5.1.0' 45 | implementation group: 'com.zendesk', name: 'chat', version: '3.1.0' 46 | 47 | implementation 'androidx.annotation:annotation:1.1.0' 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'zendesk' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/java/com/codeheadlabs/zendesk/ZendeskPigeon.java: -------------------------------------------------------------------------------- 1 | // Autogenerated from Pigeon (v0.2.1), do not edit directly. 2 | // See also: https://pub.dev/packages/pigeon 3 | 4 | package com.codeheadlabs.zendesk.pigeon; 5 | 6 | import io.flutter.plugin.common.BasicMessageChannel; 7 | import io.flutter.plugin.common.BinaryMessenger; 8 | import io.flutter.plugin.common.StandardMessageCodec; 9 | import java.util.List; 10 | import java.util.Map; 11 | import java.util.HashMap; 12 | 13 | /** Generated class from Pigeon. */ 14 | @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression"}) 15 | public class ZendeskPigeon { 16 | 17 | /** Generated class from Pigeon that represents data sent in messages. */ 18 | public static class InitializeRequest { 19 | private String accountKey; 20 | public String getAccountKey() { return accountKey; } 21 | public void setAccountKey(String setterArg) { this.accountKey = setterArg; } 22 | 23 | private String appId; 24 | public String getAppId() { return appId; } 25 | public void setAppId(String setterArg) { this.appId = setterArg; } 26 | 27 | Map toMap() { 28 | Map toMapResult = new HashMap<>(); 29 | toMapResult.put("accountKey", accountKey); 30 | toMapResult.put("appId", appId); 31 | return toMapResult; 32 | } 33 | static InitializeRequest fromMap(Map map) { 34 | InitializeRequest fromMapResult = new InitializeRequest(); 35 | Object accountKey = map.get("accountKey"); 36 | fromMapResult.accountKey = (String)accountKey; 37 | Object appId = map.get("appId"); 38 | fromMapResult.appId = (String)appId; 39 | return fromMapResult; 40 | } 41 | } 42 | 43 | /** Generated class from Pigeon that represents data sent in messages. */ 44 | public static class SetDepartmentRequest { 45 | private String department; 46 | public String getDepartment() { return department; } 47 | public void setDepartment(String setterArg) { this.department = setterArg; } 48 | 49 | Map toMap() { 50 | Map toMapResult = new HashMap<>(); 51 | toMapResult.put("department", department); 52 | return toMapResult; 53 | } 54 | static SetDepartmentRequest fromMap(Map map) { 55 | SetDepartmentRequest fromMapResult = new SetDepartmentRequest(); 56 | Object department = map.get("department"); 57 | fromMapResult.department = (String)department; 58 | return fromMapResult; 59 | } 60 | } 61 | 62 | /** Generated class from Pigeon that represents data sent in messages. */ 63 | public static class StartChatRequest { 64 | private Boolean isPreChatFormEnabled; 65 | public Boolean getIsPreChatFormEnabled() { return isPreChatFormEnabled; } 66 | public void setIsPreChatFormEnabled(Boolean setterArg) { this.isPreChatFormEnabled = setterArg; } 67 | 68 | private Boolean isOfflineFormEnabled; 69 | public Boolean getIsOfflineFormEnabled() { return isOfflineFormEnabled; } 70 | public void setIsOfflineFormEnabled(Boolean setterArg) { this.isOfflineFormEnabled = setterArg; } 71 | 72 | private Boolean isAgentAvailabilityEnabled; 73 | public Boolean getIsAgentAvailabilityEnabled() { return isAgentAvailabilityEnabled; } 74 | public void setIsAgentAvailabilityEnabled(Boolean setterArg) { this.isAgentAvailabilityEnabled = setterArg; } 75 | 76 | private Boolean isChatTranscriptPromptEnabled; 77 | public Boolean getIsChatTranscriptPromptEnabled() { return isChatTranscriptPromptEnabled; } 78 | public void setIsChatTranscriptPromptEnabled(Boolean setterArg) { this.isChatTranscriptPromptEnabled = setterArg; } 79 | 80 | private String messagingName; 81 | public String getMessagingName() { return messagingName; } 82 | public void setMessagingName(String setterArg) { this.messagingName = setterArg; } 83 | 84 | private String iosBackButtonTitle; 85 | public String getIosBackButtonTitle() { return iosBackButtonTitle; } 86 | public void setIosBackButtonTitle(String setterArg) { this.iosBackButtonTitle = setterArg; } 87 | 88 | private Long iosNavigationBarColor; 89 | public Long getIosNavigationBarColor() { return iosNavigationBarColor; } 90 | public void setIosNavigationBarColor(Long setterArg) { this.iosNavigationBarColor = setterArg; } 91 | 92 | private Long iosNavigationTitleColor; 93 | public Long getIosNavigationTitleColor() { return iosNavigationTitleColor; } 94 | public void setIosNavigationTitleColor(Long setterArg) { this.iosNavigationTitleColor = setterArg; } 95 | 96 | Map toMap() { 97 | Map toMapResult = new HashMap<>(); 98 | toMapResult.put("isPreChatFormEnabled", isPreChatFormEnabled); 99 | toMapResult.put("isOfflineFormEnabled", isOfflineFormEnabled); 100 | toMapResult.put("isAgentAvailabilityEnabled", isAgentAvailabilityEnabled); 101 | toMapResult.put("isChatTranscriptPromptEnabled", isChatTranscriptPromptEnabled); 102 | toMapResult.put("messagingName", messagingName); 103 | toMapResult.put("iosBackButtonTitle", iosBackButtonTitle); 104 | toMapResult.put("iosNavigationBarColor", iosNavigationBarColor); 105 | toMapResult.put("iosNavigationTitleColor", iosNavigationTitleColor); 106 | return toMapResult; 107 | } 108 | static StartChatRequest fromMap(Map map) { 109 | StartChatRequest fromMapResult = new StartChatRequest(); 110 | Object isPreChatFormEnabled = map.get("isPreChatFormEnabled"); 111 | fromMapResult.isPreChatFormEnabled = (Boolean)isPreChatFormEnabled; 112 | Object isOfflineFormEnabled = map.get("isOfflineFormEnabled"); 113 | fromMapResult.isOfflineFormEnabled = (Boolean)isOfflineFormEnabled; 114 | Object isAgentAvailabilityEnabled = map.get("isAgentAvailabilityEnabled"); 115 | fromMapResult.isAgentAvailabilityEnabled = (Boolean)isAgentAvailabilityEnabled; 116 | Object isChatTranscriptPromptEnabled = map.get("isChatTranscriptPromptEnabled"); 117 | fromMapResult.isChatTranscriptPromptEnabled = (Boolean)isChatTranscriptPromptEnabled; 118 | Object messagingName = map.get("messagingName"); 119 | fromMapResult.messagingName = (String)messagingName; 120 | Object iosBackButtonTitle = map.get("iosBackButtonTitle"); 121 | fromMapResult.iosBackButtonTitle = (String)iosBackButtonTitle; 122 | Object iosNavigationBarColor = map.get("iosNavigationBarColor"); 123 | fromMapResult.iosNavigationBarColor = (iosNavigationBarColor == null) ? null : ((iosNavigationBarColor instanceof Integer) ? (Integer)iosNavigationBarColor : (Long)iosNavigationBarColor); 124 | Object iosNavigationTitleColor = map.get("iosNavigationTitleColor"); 125 | fromMapResult.iosNavigationTitleColor = (iosNavigationTitleColor == null) ? null : ((iosNavigationTitleColor instanceof Integer) ? (Integer)iosNavigationTitleColor : (Long)iosNavigationTitleColor); 126 | return fromMapResult; 127 | } 128 | } 129 | 130 | /** Generated class from Pigeon that represents data sent in messages. */ 131 | public static class SetVisitorInfoRequest { 132 | private String name; 133 | public String getName() { return name; } 134 | public void setName(String setterArg) { this.name = setterArg; } 135 | 136 | private String email; 137 | public String getEmail() { return email; } 138 | public void setEmail(String setterArg) { this.email = setterArg; } 139 | 140 | private String phoneNumber; 141 | public String getPhoneNumber() { return phoneNumber; } 142 | public void setPhoneNumber(String setterArg) { this.phoneNumber = setterArg; } 143 | 144 | Map toMap() { 145 | Map toMapResult = new HashMap<>(); 146 | toMapResult.put("name", name); 147 | toMapResult.put("email", email); 148 | toMapResult.put("phoneNumber", phoneNumber); 149 | return toMapResult; 150 | } 151 | static SetVisitorInfoRequest fromMap(Map map) { 152 | SetVisitorInfoRequest fromMapResult = new SetVisitorInfoRequest(); 153 | Object name = map.get("name"); 154 | fromMapResult.name = (String)name; 155 | Object email = map.get("email"); 156 | fromMapResult.email = (String)email; 157 | Object phoneNumber = map.get("phoneNumber"); 158 | fromMapResult.phoneNumber = (String)phoneNumber; 159 | return fromMapResult; 160 | } 161 | } 162 | 163 | /** Generated class from Pigeon that represents data sent in messages. */ 164 | public static class VisitorTagsRequest { 165 | private List tags; 166 | public List getTags() { return tags; } 167 | public void setTags(List setterArg) { this.tags = setterArg; } 168 | 169 | Map toMap() { 170 | Map toMapResult = new HashMap<>(); 171 | toMapResult.put("tags", tags); 172 | return toMapResult; 173 | } 174 | static VisitorTagsRequest fromMap(Map map) { 175 | VisitorTagsRequest fromMapResult = new VisitorTagsRequest(); 176 | Object tags = map.get("tags"); 177 | fromMapResult.tags = (List)tags; 178 | return fromMapResult; 179 | } 180 | } 181 | 182 | /** Generated class from Pigeon that represents data sent in messages. */ 183 | public static class VisitorNoteRequest { 184 | private String note; 185 | public String getNote() { return note; } 186 | public void setNote(String setterArg) { this.note = setterArg; } 187 | 188 | Map toMap() { 189 | Map toMapResult = new HashMap<>(); 190 | toMapResult.put("note", note); 191 | return toMapResult; 192 | } 193 | static VisitorNoteRequest fromMap(Map map) { 194 | VisitorNoteRequest fromMapResult = new VisitorNoteRequest(); 195 | Object note = map.get("note"); 196 | fromMapResult.note = (String)note; 197 | return fromMapResult; 198 | } 199 | } 200 | 201 | /** Generated interface from Pigeon that represents a handler of messages from Flutter.*/ 202 | public interface ChatApi { 203 | void initialize(InitializeRequest arg); 204 | void setDepartment(SetDepartmentRequest arg); 205 | void startChat(StartChatRequest arg); 206 | 207 | /** Sets up an instance of `ChatApi` to handle messages through the `binaryMessenger`. */ 208 | static void setup(BinaryMessenger binaryMessenger, ChatApi api) { 209 | { 210 | BasicMessageChannel channel = 211 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.ChatApi.initialize", new StandardMessageCodec()); 212 | if (api != null) { 213 | channel.setMessageHandler((message, reply) -> { 214 | Map wrapped = new HashMap<>(); 215 | try { 216 | @SuppressWarnings("ConstantConditions") 217 | InitializeRequest input = InitializeRequest.fromMap((Map)message); 218 | api.initialize(input); 219 | wrapped.put("result", null); 220 | } 221 | catch (Error | RuntimeException exception) { 222 | wrapped.put("error", wrapError(exception)); 223 | } 224 | reply.reply(wrapped); 225 | }); 226 | } else { 227 | channel.setMessageHandler(null); 228 | } 229 | } 230 | { 231 | BasicMessageChannel channel = 232 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.ChatApi.setDepartment", new StandardMessageCodec()); 233 | if (api != null) { 234 | channel.setMessageHandler((message, reply) -> { 235 | Map wrapped = new HashMap<>(); 236 | try { 237 | @SuppressWarnings("ConstantConditions") 238 | SetDepartmentRequest input = SetDepartmentRequest.fromMap((Map)message); 239 | api.setDepartment(input); 240 | wrapped.put("result", null); 241 | } 242 | catch (Error | RuntimeException exception) { 243 | wrapped.put("error", wrapError(exception)); 244 | } 245 | reply.reply(wrapped); 246 | }); 247 | } else { 248 | channel.setMessageHandler(null); 249 | } 250 | } 251 | { 252 | BasicMessageChannel channel = 253 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.ChatApi.startChat", new StandardMessageCodec()); 254 | if (api != null) { 255 | channel.setMessageHandler((message, reply) -> { 256 | Map wrapped = new HashMap<>(); 257 | try { 258 | @SuppressWarnings("ConstantConditions") 259 | StartChatRequest input = StartChatRequest.fromMap((Map)message); 260 | api.startChat(input); 261 | wrapped.put("result", null); 262 | } 263 | catch (Error | RuntimeException exception) { 264 | wrapped.put("error", wrapError(exception)); 265 | } 266 | reply.reply(wrapped); 267 | }); 268 | } else { 269 | channel.setMessageHandler(null); 270 | } 271 | } 272 | } 273 | } 274 | 275 | /** Generated interface from Pigeon that represents a handler of messages from Flutter.*/ 276 | public interface ProfileApi { 277 | void setVisitorInfo(SetVisitorInfoRequest arg); 278 | void addVisitorTags(VisitorTagsRequest arg); 279 | void removeVisitorTags(VisitorTagsRequest arg); 280 | void setVisitorNote(VisitorNoteRequest arg); 281 | void appendVisitorNote(VisitorNoteRequest arg); 282 | void clearVisitorNotes(); 283 | 284 | /** Sets up an instance of `ProfileApi` to handle messages through the `binaryMessenger`. */ 285 | static void setup(BinaryMessenger binaryMessenger, ProfileApi api) { 286 | { 287 | BasicMessageChannel channel = 288 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.ProfileApi.setVisitorInfo", new StandardMessageCodec()); 289 | if (api != null) { 290 | channel.setMessageHandler((message, reply) -> { 291 | Map wrapped = new HashMap<>(); 292 | try { 293 | @SuppressWarnings("ConstantConditions") 294 | SetVisitorInfoRequest input = SetVisitorInfoRequest.fromMap((Map)message); 295 | api.setVisitorInfo(input); 296 | wrapped.put("result", null); 297 | } 298 | catch (Error | RuntimeException exception) { 299 | wrapped.put("error", wrapError(exception)); 300 | } 301 | reply.reply(wrapped); 302 | }); 303 | } else { 304 | channel.setMessageHandler(null); 305 | } 306 | } 307 | { 308 | BasicMessageChannel channel = 309 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.ProfileApi.addVisitorTags", new StandardMessageCodec()); 310 | if (api != null) { 311 | channel.setMessageHandler((message, reply) -> { 312 | Map wrapped = new HashMap<>(); 313 | try { 314 | @SuppressWarnings("ConstantConditions") 315 | VisitorTagsRequest input = VisitorTagsRequest.fromMap((Map)message); 316 | api.addVisitorTags(input); 317 | wrapped.put("result", null); 318 | } 319 | catch (Error | RuntimeException exception) { 320 | wrapped.put("error", wrapError(exception)); 321 | } 322 | reply.reply(wrapped); 323 | }); 324 | } else { 325 | channel.setMessageHandler(null); 326 | } 327 | } 328 | { 329 | BasicMessageChannel channel = 330 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.ProfileApi.removeVisitorTags", new StandardMessageCodec()); 331 | if (api != null) { 332 | channel.setMessageHandler((message, reply) -> { 333 | Map wrapped = new HashMap<>(); 334 | try { 335 | @SuppressWarnings("ConstantConditions") 336 | VisitorTagsRequest input = VisitorTagsRequest.fromMap((Map)message); 337 | api.removeVisitorTags(input); 338 | wrapped.put("result", null); 339 | } 340 | catch (Error | RuntimeException exception) { 341 | wrapped.put("error", wrapError(exception)); 342 | } 343 | reply.reply(wrapped); 344 | }); 345 | } else { 346 | channel.setMessageHandler(null); 347 | } 348 | } 349 | { 350 | BasicMessageChannel channel = 351 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.ProfileApi.setVisitorNote", new StandardMessageCodec()); 352 | if (api != null) { 353 | channel.setMessageHandler((message, reply) -> { 354 | Map wrapped = new HashMap<>(); 355 | try { 356 | @SuppressWarnings("ConstantConditions") 357 | VisitorNoteRequest input = VisitorNoteRequest.fromMap((Map)message); 358 | api.setVisitorNote(input); 359 | wrapped.put("result", null); 360 | } 361 | catch (Error | RuntimeException exception) { 362 | wrapped.put("error", wrapError(exception)); 363 | } 364 | reply.reply(wrapped); 365 | }); 366 | } else { 367 | channel.setMessageHandler(null); 368 | } 369 | } 370 | { 371 | BasicMessageChannel channel = 372 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.ProfileApi.appendVisitorNote", new StandardMessageCodec()); 373 | if (api != null) { 374 | channel.setMessageHandler((message, reply) -> { 375 | Map wrapped = new HashMap<>(); 376 | try { 377 | @SuppressWarnings("ConstantConditions") 378 | VisitorNoteRequest input = VisitorNoteRequest.fromMap((Map)message); 379 | api.appendVisitorNote(input); 380 | wrapped.put("result", null); 381 | } 382 | catch (Error | RuntimeException exception) { 383 | wrapped.put("error", wrapError(exception)); 384 | } 385 | reply.reply(wrapped); 386 | }); 387 | } else { 388 | channel.setMessageHandler(null); 389 | } 390 | } 391 | { 392 | BasicMessageChannel channel = 393 | new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.ProfileApi.clearVisitorNotes", new StandardMessageCodec()); 394 | if (api != null) { 395 | channel.setMessageHandler((message, reply) -> { 396 | Map wrapped = new HashMap<>(); 397 | try { 398 | api.clearVisitorNotes(); 399 | wrapped.put("result", null); 400 | } 401 | catch (Error | RuntimeException exception) { 402 | wrapped.put("error", wrapError(exception)); 403 | } 404 | reply.reply(wrapped); 405 | }); 406 | } else { 407 | channel.setMessageHandler(null); 408 | } 409 | } 410 | } 411 | } 412 | private static Map wrapError(Throwable exception) { 413 | Map errorMap = new HashMap<>(); 414 | errorMap.put("message", exception.toString()); 415 | errorMap.put("code", exception.getClass().getSimpleName()); 416 | errorMap.put("details", null); 417 | return errorMap; 418 | } 419 | } 420 | -------------------------------------------------------------------------------- /android/src/main/java/com/codeheadlabs/zendesk/ZendeskPlugin.java: -------------------------------------------------------------------------------- 1 | package com.codeheadlabs.zendesk; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.text.TextUtils; 6 | import androidx.annotation.NonNull; 7 | import com.codeheadlabs.zendesk.pigeon.ZendeskPigeon.ChatApi; 8 | import com.codeheadlabs.zendesk.pigeon.ZendeskPigeon.InitializeRequest; 9 | import com.codeheadlabs.zendesk.pigeon.ZendeskPigeon.ProfileApi; 10 | import com.codeheadlabs.zendesk.pigeon.ZendeskPigeon.SetDepartmentRequest; 11 | import com.codeheadlabs.zendesk.pigeon.ZendeskPigeon.SetVisitorInfoRequest; 12 | import com.codeheadlabs.zendesk.pigeon.ZendeskPigeon.StartChatRequest; 13 | import com.codeheadlabs.zendesk.pigeon.ZendeskPigeon.VisitorNoteRequest; 14 | import com.codeheadlabs.zendesk.pigeon.ZendeskPigeon.VisitorTagsRequest; 15 | import io.flutter.embedding.engine.plugins.FlutterPlugin; 16 | import io.flutter.embedding.engine.plugins.activity.ActivityAware; 17 | import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; 18 | import io.flutter.plugin.common.BinaryMessenger; 19 | import io.flutter.plugin.common.PluginRegistry.Registrar; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | import zendesk.chat.Chat; 23 | import zendesk.chat.ChatConfiguration; 24 | import zendesk.chat.ChatEngine; 25 | import zendesk.chat.ChatProvider; 26 | import zendesk.chat.ProfileProvider; 27 | import zendesk.chat.Providers; 28 | import zendesk.chat.VisitorInfo; 29 | import zendesk.chat.VisitorInfo.Builder; 30 | import zendesk.messaging.MessagingActivity; 31 | 32 | /** ZendeskPlugin */ 33 | public class ZendeskPlugin implements FlutterPlugin, ActivityAware, ChatApi, ProfileApi { 34 | 35 | private Context applicationContext; 36 | private Activity activity; 37 | 38 | public ZendeskPlugin() {} 39 | 40 | @Override 41 | public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) { 42 | startListening(binding.getApplicationContext(), binding.getBinaryMessenger()); 43 | } 44 | 45 | @Override 46 | public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { 47 | applicationContext = null; 48 | } 49 | 50 | private void startListening(Context applicationContext, BinaryMessenger messenger) { 51 | ChatApi.setup(messenger, this); 52 | ProfileApi.setup(messenger, this); 53 | 54 | this.applicationContext = applicationContext; 55 | } 56 | 57 | @Override 58 | public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) { 59 | activity = binding.getActivity(); 60 | } 61 | 62 | @Override 63 | public void onDetachedFromActivityForConfigChanges() { 64 | activity = null; 65 | } 66 | 67 | @Override 68 | public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding binding) { 69 | activity = binding.getActivity(); 70 | } 71 | 72 | @Override 73 | public void onDetachedFromActivity() { 74 | activity = null; 75 | } 76 | 77 | @Override 78 | public void initialize(InitializeRequest arg) { 79 | if (arg.getAccountKey() == null) { 80 | throw new IllegalArgumentException("accountKey missing"); 81 | } 82 | 83 | if (arg.getAppId() != null) { 84 | Chat.INSTANCE.init(applicationContext, arg.getAccountKey(), arg.getAppId()); 85 | } else { 86 | Chat.INSTANCE.init(applicationContext, arg.getAccountKey()); 87 | } 88 | } 89 | 90 | @Override 91 | public void setDepartment(SetDepartmentRequest arg) { 92 | Providers providers = Chat.INSTANCE.providers(); 93 | 94 | if (providers == null) { 95 | throw new IllegalArgumentException("providers not set - did you call initialize?"); 96 | } 97 | 98 | ChatProvider chatProvider = providers.chatProvider(); 99 | chatProvider.setDepartment(arg.getDepartment(), null); 100 | } 101 | 102 | @Override 103 | public void startChat(StartChatRequest arg) { 104 | if (activity == null) { 105 | return; 106 | } 107 | 108 | ChatConfiguration chatConfiguration = 109 | ChatConfiguration.builder() 110 | .withAgentAvailabilityEnabled(arg.getIsAgentAvailabilityEnabled()) 111 | .withPreChatFormEnabled(arg.getIsPreChatFormEnabled()) 112 | .withOfflineFormEnabled(arg.getIsOfflineFormEnabled()) 113 | .withTranscriptEnabled(arg.getIsChatTranscriptPromptEnabled()) 114 | .build(); 115 | 116 | MessagingActivity.builder().withEngines(ChatEngine.engine()).show(activity, chatConfiguration); 117 | } 118 | 119 | @Override 120 | public void setVisitorInfo(SetVisitorInfoRequest arg) { 121 | final ProfileProvider profileProvider = getProfileProvider(); 122 | 123 | Builder builder = VisitorInfo.builder(); 124 | if (!TextUtils.isEmpty(arg.getName())) { 125 | builder = builder.withName(arg.getName()); 126 | } 127 | if (!TextUtils.isEmpty(arg.getEmail())) { 128 | builder = builder.withEmail(arg.getEmail()); 129 | } 130 | if (!TextUtils.isEmpty(arg.getPhoneNumber())) { 131 | builder = builder.withPhoneNumber(arg.getPhoneNumber()); 132 | } 133 | 134 | profileProvider.setVisitorInfo(builder.build(), null); 135 | } 136 | 137 | @SuppressWarnings("rawtypes") 138 | @Override 139 | public void addVisitorTags(VisitorTagsRequest arg) { 140 | final ProfileProvider profileProvider = getProfileProvider(); 141 | List raw = arg.getTags(); 142 | ArrayList tags = new ArrayList<>(); 143 | for (Object o : raw) { 144 | if (o instanceof String) { 145 | tags.add((String) o); 146 | } 147 | } 148 | profileProvider.addVisitorTags(tags, null); 149 | } 150 | 151 | @SuppressWarnings("rawtypes") 152 | @Override 153 | public void removeVisitorTags(VisitorTagsRequest arg) { 154 | final ProfileProvider profileProvider = getProfileProvider(); 155 | List raw = arg.getTags(); 156 | ArrayList tags = new ArrayList<>(); 157 | for (Object o : raw) { 158 | if (o instanceof String) { 159 | tags.add((String) o); 160 | } 161 | } 162 | profileProvider.removeVisitorTags(tags, null); 163 | } 164 | 165 | @Override 166 | public void setVisitorNote(VisitorNoteRequest arg) { 167 | final ProfileProvider profileProvider = getProfileProvider(); 168 | profileProvider.setVisitorNote(arg.getNote()); 169 | } 170 | 171 | @Override 172 | public void appendVisitorNote(VisitorNoteRequest arg) { 173 | final ProfileProvider profileProvider = getProfileProvider(); 174 | profileProvider.appendVisitorNote(arg.getNote()); 175 | } 176 | 177 | @Override 178 | public void clearVisitorNotes() { 179 | final ProfileProvider profileProvider = getProfileProvider(); 180 | profileProvider.clearVisitorNotes(null); 181 | } 182 | 183 | private ProfileProvider getProfileProvider() { 184 | Providers providers = Chat.INSTANCE.providers(); 185 | if (providers == null) { 186 | throw new IllegalArgumentException("providers not set - did you call initialize?"); 187 | } 188 | 189 | return providers.profileProvider(); 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .flutter-plugins 10 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: e4b989bf3dbefc61f11bce298d16f92ebd9cde41 8 | channel: master 9 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # zendesk_example 2 | 3 | Demonstrates how to use the zendesk plugin. 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view our online 8 | [documentation](https://flutter.io/). 9 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 29 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | applicationId "com.codeheadlabs.zendeskexample" 36 | minSdkVersion 16 37 | targetSdkVersion 29 38 | versionCode flutterVersionCode.toInteger() 39 | versionName flutterVersionName 40 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 41 | } 42 | 43 | buildTypes { 44 | release { 45 | // TODO: Add your own signing config for the release build. 46 | // Signing with the debug keys for now, so `flutter run --release` works. 47 | signingConfig signingConfigs.debug 48 | } 49 | } 50 | } 51 | 52 | flutter { 53 | source '../..' 54 | } 55 | 56 | dependencies { 57 | testImplementation 'junit:junit:4.12' 58 | 59 | implementation "androidx.appcompat:appcompat:1.2.0" 60 | 61 | androidTestImplementation 'androidx.test:runner:1.3.0' 62 | androidTestImplementation 'androidx.test:rules:1.3.0' 63 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' 64 | } -------------------------------------------------------------------------------- /example/android/app/src/androidTest/java/com/codeheadlabs/zendesk/MainActivityTest.java: -------------------------------------------------------------------------------- 1 | package com.codeheadlabs.zendesk; 2 | 3 | import androidx.test.rule.ActivityTestRule; 4 | import dev.flutter.plugins.e2e.FlutterTestRunner; 5 | import org.junit.Rule; 6 | import org.junit.runner.RunWith; 7 | 8 | @RunWith(FlutterTestRunner.class) 9 | public class MainActivityTest { 10 | 11 | @Rule 12 | public ActivityTestRule rule = new ActivityTestRule<>( 13 | io.flutter.embedding.android.FlutterActivity.class); 14 | } -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | 17 | 24 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.6.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableJetifier=true 3 | android.useAndroidX=true 4 | android.enableR8=true 5 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Mar 30 21:48:03 BST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/integration_test/visitor_info_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:integration_test/integration_test.dart'; 3 | import 'package:zendesk/zendesk.dart'; 4 | 5 | void main() { 6 | IntegrationTestWidgetsFlutterBinding.ensureInitialized(); 7 | 8 | testWidgets('sets visitor info', (WidgetTester tester) async { 9 | await Zendesk().init('ABC'); 10 | 11 | await Zendesk().setVisitorInfo( 12 | name: 'some-user', 13 | email: 'email@domain.com', 14 | phoneNumber: '12341234', 15 | ); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/app.flx 37 | /Flutter/app.zip 38 | /Flutter/flutter_assets/ 39 | /Flutter/App.framework 40 | /Flutter/Flutter.framework 41 | /Flutter/Generated.xcconfig 42 | /ServiceDefinitions.json 43 | 44 | Pods/ 45 | .symlinks/ 46 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | FLUTTER_BUILD_MODE=debug 4 | -------------------------------------------------------------------------------- /example/ios/Flutter/Flutter.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: This podspec is NOT to be published. It is only used as a local source! 3 | # 4 | 5 | Pod::Spec.new do |s| 6 | s.name = 'Flutter' 7 | s.version = '1.0.0' 8 | s.summary = 'High-performance, high-fidelity mobile apps.' 9 | s.description = <<-DESC 10 | Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS. 11 | DESC 12 | s.homepage = 'https://flutter.io' 13 | s.license = { :type => 'MIT' } 14 | s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } 15 | s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } 16 | s.ios.deployment_target = '8.0' 17 | s.vendored_frameworks = 'Flutter.framework' 18 | end 19 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 6A52213C2C9C6D6EB9BE537B /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B15B1DBE9A561DF12D149576 /* libPods-Runner.a */; }; 13 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 14 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 15 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 16 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 17 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXCopyFilesBuildPhase section */ 21 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 22 | isa = PBXCopyFilesBuildPhase; 23 | buildActionMask = 2147483647; 24 | dstPath = ""; 25 | dstSubfolderSpec = 10; 26 | files = ( 27 | ); 28 | name = "Embed Frameworks"; 29 | runOnlyForDeploymentPostprocessing = 0; 30 | }; 31 | /* End PBXCopyFilesBuildPhase section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 36 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 39 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 40 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 41 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 42 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 44 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | B15B1DBE9A561DF12D149576 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | B516A65322E23314BC730DAF /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 50 | E54E2A4E6660564F288433A2 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 51 | /* End PBXFileReference section */ 52 | 53 | /* Begin PBXFrameworksBuildPhase section */ 54 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | 6A52213C2C9C6D6EB9BE537B /* libPods-Runner.a in Frameworks */, 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | /* End PBXFrameworksBuildPhase section */ 63 | 64 | /* Begin PBXGroup section */ 65 | 285C6F2651274187E169EECA /* Frameworks */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | B15B1DBE9A561DF12D149576 /* libPods-Runner.a */, 69 | ); 70 | name = Frameworks; 71 | sourceTree = ""; 72 | }; 73 | 4327D9E7543BF1260A867709 /* Pods */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | E54E2A4E6660564F288433A2 /* Pods-Runner.debug.xcconfig */, 77 | B516A65322E23314BC730DAF /* Pods-Runner.release.xcconfig */, 78 | ); 79 | name = Pods; 80 | sourceTree = ""; 81 | }; 82 | 9740EEB11CF90186004384FC /* Flutter */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 86 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 87 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 88 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 89 | ); 90 | name = Flutter; 91 | sourceTree = ""; 92 | }; 93 | 97C146E51CF9000F007C117D = { 94 | isa = PBXGroup; 95 | children = ( 96 | 9740EEB11CF90186004384FC /* Flutter */, 97 | 97C146F01CF9000F007C117D /* Runner */, 98 | 97C146EF1CF9000F007C117D /* Products */, 99 | 4327D9E7543BF1260A867709 /* Pods */, 100 | 285C6F2651274187E169EECA /* Frameworks */, 101 | ); 102 | sourceTree = ""; 103 | }; 104 | 97C146EF1CF9000F007C117D /* Products */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 97C146EE1CF9000F007C117D /* Runner.app */, 108 | ); 109 | name = Products; 110 | sourceTree = ""; 111 | }; 112 | 97C146F01CF9000F007C117D /* Runner */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 116 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 117 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 118 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 119 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 120 | 97C147021CF9000F007C117D /* Info.plist */, 121 | 97C146F11CF9000F007C117D /* Supporting Files */, 122 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 123 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 124 | ); 125 | path = Runner; 126 | sourceTree = ""; 127 | }; 128 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 97C146F21CF9000F007C117D /* main.m */, 132 | ); 133 | name = "Supporting Files"; 134 | sourceTree = ""; 135 | }; 136 | /* End PBXGroup section */ 137 | 138 | /* Begin PBXNativeTarget section */ 139 | 97C146ED1CF9000F007C117D /* Runner */ = { 140 | isa = PBXNativeTarget; 141 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 142 | buildPhases = ( 143 | F40C6C68D29C31D32E9C568B /* [CP] Check Pods Manifest.lock */, 144 | 9740EEB61CF901F6004384FC /* Run Script */, 145 | 97C146EA1CF9000F007C117D /* Sources */, 146 | 97C146EB1CF9000F007C117D /* Frameworks */, 147 | 97C146EC1CF9000F007C117D /* Resources */, 148 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 149 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 150 | F42E6617638C4E448FBF8294 /* [CP] Embed Pods Frameworks */, 151 | ); 152 | buildRules = ( 153 | ); 154 | dependencies = ( 155 | ); 156 | name = Runner; 157 | productName = Runner; 158 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 159 | productType = "com.apple.product-type.application"; 160 | }; 161 | /* End PBXNativeTarget section */ 162 | 163 | /* Begin PBXProject section */ 164 | 97C146E61CF9000F007C117D /* Project object */ = { 165 | isa = PBXProject; 166 | attributes = { 167 | LastUpgradeCheck = 1150; 168 | ORGANIZATIONNAME = "The Chromium Authors"; 169 | TargetAttributes = { 170 | 97C146ED1CF9000F007C117D = { 171 | CreatedOnToolsVersion = 7.3.1; 172 | }; 173 | }; 174 | }; 175 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 176 | compatibilityVersion = "Xcode 3.2"; 177 | developmentRegion = en; 178 | hasScannedForEncodings = 0; 179 | knownRegions = ( 180 | en, 181 | Base, 182 | ); 183 | mainGroup = 97C146E51CF9000F007C117D; 184 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 185 | projectDirPath = ""; 186 | projectRoot = ""; 187 | targets = ( 188 | 97C146ED1CF9000F007C117D /* Runner */, 189 | ); 190 | }; 191 | /* End PBXProject section */ 192 | 193 | /* Begin PBXResourcesBuildPhase section */ 194 | 97C146EC1CF9000F007C117D /* Resources */ = { 195 | isa = PBXResourcesBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 199 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 200 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 201 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 202 | ); 203 | runOnlyForDeploymentPostprocessing = 0; 204 | }; 205 | /* End PBXResourcesBuildPhase section */ 206 | 207 | /* Begin PBXShellScriptBuildPhase section */ 208 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 209 | isa = PBXShellScriptBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | ); 213 | inputPaths = ( 214 | ); 215 | name = "Thin Binary"; 216 | outputPaths = ( 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | shellPath = /bin/sh; 220 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 221 | }; 222 | 9740EEB61CF901F6004384FC /* Run Script */ = { 223 | isa = PBXShellScriptBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | ); 227 | inputPaths = ( 228 | ); 229 | name = "Run Script"; 230 | outputPaths = ( 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | shellPath = /bin/sh; 234 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 235 | }; 236 | F40C6C68D29C31D32E9C568B /* [CP] Check Pods Manifest.lock */ = { 237 | isa = PBXShellScriptBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | ); 241 | inputPaths = ( 242 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 243 | "${PODS_ROOT}/Manifest.lock", 244 | ); 245 | name = "[CP] Check Pods Manifest.lock"; 246 | outputPaths = ( 247 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | shellPath = /bin/sh; 251 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 252 | showEnvVarsInLog = 0; 253 | }; 254 | F42E6617638C4E448FBF8294 /* [CP] Embed Pods Frameworks */ = { 255 | isa = PBXShellScriptBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ); 259 | inputPaths = ( 260 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 261 | "${PODS_ROOT}/../Flutter/Flutter.framework", 262 | "${PODS_ROOT}/ZendeskChatProvidersSDK/ChatProvidersSDK.framework", 263 | "${PODS_ROOT}/ZendeskChatSDK/ChatSDK.framework", 264 | "${PODS_ROOT}/ZendeskCommonUISDK/CommonUISDK.framework", 265 | "${PODS_ROOT}/ZendeskMessagingAPISDK/MessagingAPI.framework", 266 | "${PODS_ROOT}/ZendeskMessagingSDK/MessagingSDK.framework", 267 | "${PODS_ROOT}/ZendeskSDKConfigurationsSDK/SDKConfigurations.framework", 268 | "${PODS_ROOT}/ZendeskSDKConfigurationsSDK/SDKConfigurations.framework.dSYM", 269 | ); 270 | name = "[CP] Embed Pods Frameworks"; 271 | outputPaths = ( 272 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 273 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ChatProvidersSDK.framework", 274 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ChatSDK.framework", 275 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CommonUISDK.framework", 276 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MessagingAPI.framework", 277 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MessagingSDK.framework", 278 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDKConfigurations.framework", 279 | "${DWARF_DSYM_FOLDER_PATH}/SDKConfigurations.framework.dSYM", 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | shellPath = /bin/sh; 283 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 284 | showEnvVarsInLog = 0; 285 | }; 286 | /* End PBXShellScriptBuildPhase section */ 287 | 288 | /* Begin PBXSourcesBuildPhase section */ 289 | 97C146EA1CF9000F007C117D /* Sources */ = { 290 | isa = PBXSourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 294 | 97C146F31CF9000F007C117D /* main.m in Sources */, 295 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 296 | ); 297 | runOnlyForDeploymentPostprocessing = 0; 298 | }; 299 | /* End PBXSourcesBuildPhase section */ 300 | 301 | /* Begin PBXVariantGroup section */ 302 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 303 | isa = PBXVariantGroup; 304 | children = ( 305 | 97C146FB1CF9000F007C117D /* Base */, 306 | ); 307 | name = Main.storyboard; 308 | sourceTree = ""; 309 | }; 310 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 311 | isa = PBXVariantGroup; 312 | children = ( 313 | 97C147001CF9000F007C117D /* Base */, 314 | ); 315 | name = LaunchScreen.storyboard; 316 | sourceTree = ""; 317 | }; 318 | /* End PBXVariantGroup section */ 319 | 320 | /* Begin XCBuildConfiguration section */ 321 | 97C147031CF9000F007C117D /* Debug */ = { 322 | isa = XCBuildConfiguration; 323 | buildSettings = { 324 | ALWAYS_SEARCH_USER_PATHS = NO; 325 | CLANG_ANALYZER_NONNULL = YES; 326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 327 | CLANG_CXX_LIBRARY = "libc++"; 328 | CLANG_ENABLE_MODULES = YES; 329 | CLANG_ENABLE_OBJC_ARC = YES; 330 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 331 | CLANG_WARN_BOOL_CONVERSION = YES; 332 | CLANG_WARN_COMMA = YES; 333 | CLANG_WARN_CONSTANT_CONVERSION = YES; 334 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 335 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 336 | CLANG_WARN_EMPTY_BODY = YES; 337 | CLANG_WARN_ENUM_CONVERSION = YES; 338 | CLANG_WARN_INFINITE_RECURSION = YES; 339 | CLANG_WARN_INT_CONVERSION = YES; 340 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 341 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 342 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 343 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 344 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 345 | CLANG_WARN_STRICT_PROTOTYPES = YES; 346 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 347 | CLANG_WARN_UNREACHABLE_CODE = YES; 348 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 349 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 350 | COPY_PHASE_STRIP = NO; 351 | DEBUG_INFORMATION_FORMAT = dwarf; 352 | ENABLE_STRICT_OBJC_MSGSEND = YES; 353 | ENABLE_TESTABILITY = YES; 354 | GCC_C_LANGUAGE_STANDARD = gnu99; 355 | GCC_DYNAMIC_NO_PIC = NO; 356 | GCC_NO_COMMON_BLOCKS = YES; 357 | GCC_OPTIMIZATION_LEVEL = 0; 358 | GCC_PREPROCESSOR_DEFINITIONS = ( 359 | "DEBUG=1", 360 | "$(inherited)", 361 | ); 362 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 363 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 364 | GCC_WARN_UNDECLARED_SELECTOR = YES; 365 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 366 | GCC_WARN_UNUSED_FUNCTION = YES; 367 | GCC_WARN_UNUSED_VARIABLE = YES; 368 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 369 | MTL_ENABLE_DEBUG_INFO = YES; 370 | ONLY_ACTIVE_ARCH = YES; 371 | SDKROOT = iphoneos; 372 | TARGETED_DEVICE_FAMILY = "1,2"; 373 | }; 374 | name = Debug; 375 | }; 376 | 97C147041CF9000F007C117D /* Release */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | ALWAYS_SEARCH_USER_PATHS = NO; 380 | CLANG_ANALYZER_NONNULL = YES; 381 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 382 | CLANG_CXX_LIBRARY = "libc++"; 383 | CLANG_ENABLE_MODULES = YES; 384 | CLANG_ENABLE_OBJC_ARC = YES; 385 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 386 | CLANG_WARN_BOOL_CONVERSION = YES; 387 | CLANG_WARN_COMMA = YES; 388 | CLANG_WARN_CONSTANT_CONVERSION = YES; 389 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 390 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 391 | CLANG_WARN_EMPTY_BODY = YES; 392 | CLANG_WARN_ENUM_CONVERSION = YES; 393 | CLANG_WARN_INFINITE_RECURSION = YES; 394 | CLANG_WARN_INT_CONVERSION = YES; 395 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 396 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 397 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 398 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 399 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 400 | CLANG_WARN_STRICT_PROTOTYPES = YES; 401 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 402 | CLANG_WARN_UNREACHABLE_CODE = YES; 403 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 404 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 405 | COPY_PHASE_STRIP = NO; 406 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 407 | ENABLE_NS_ASSERTIONS = NO; 408 | ENABLE_STRICT_OBJC_MSGSEND = YES; 409 | GCC_C_LANGUAGE_STANDARD = gnu99; 410 | GCC_NO_COMMON_BLOCKS = YES; 411 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 412 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 413 | GCC_WARN_UNDECLARED_SELECTOR = YES; 414 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 415 | GCC_WARN_UNUSED_FUNCTION = YES; 416 | GCC_WARN_UNUSED_VARIABLE = YES; 417 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 418 | MTL_ENABLE_DEBUG_INFO = NO; 419 | SDKROOT = iphoneos; 420 | TARGETED_DEVICE_FAMILY = "1,2"; 421 | VALIDATE_PRODUCT = YES; 422 | }; 423 | name = Release; 424 | }; 425 | 97C147061CF9000F007C117D /* Debug */ = { 426 | isa = XCBuildConfiguration; 427 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 428 | buildSettings = { 429 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 430 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 431 | DEVELOPMENT_TEAM = ""; 432 | ENABLE_BITCODE = NO; 433 | FRAMEWORK_SEARCH_PATHS = ( 434 | "$(inherited)", 435 | "$(PROJECT_DIR)/Flutter", 436 | ); 437 | INFOPLIST_FILE = Runner/Info.plist; 438 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 439 | LIBRARY_SEARCH_PATHS = ( 440 | "$(inherited)", 441 | "$(PROJECT_DIR)/Flutter", 442 | ); 443 | PRODUCT_BUNDLE_IDENTIFIER = com.codeheadlabs.zendeskExample; 444 | PRODUCT_NAME = "$(TARGET_NAME)"; 445 | VERSIONING_SYSTEM = "apple-generic"; 446 | }; 447 | name = Debug; 448 | }; 449 | 97C147071CF9000F007C117D /* Release */ = { 450 | isa = XCBuildConfiguration; 451 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 452 | buildSettings = { 453 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 454 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 455 | DEVELOPMENT_TEAM = ""; 456 | ENABLE_BITCODE = NO; 457 | FRAMEWORK_SEARCH_PATHS = ( 458 | "$(inherited)", 459 | "$(PROJECT_DIR)/Flutter", 460 | ); 461 | INFOPLIST_FILE = Runner/Info.plist; 462 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 463 | LIBRARY_SEARCH_PATHS = ( 464 | "$(inherited)", 465 | "$(PROJECT_DIR)/Flutter", 466 | ); 467 | PRODUCT_BUNDLE_IDENTIFIER = com.codeheadlabs.zendeskExample; 468 | PRODUCT_NAME = "$(TARGET_NAME)"; 469 | VERSIONING_SYSTEM = "apple-generic"; 470 | }; 471 | name = Release; 472 | }; 473 | /* End XCBuildConfiguration section */ 474 | 475 | /* Begin XCConfigurationList section */ 476 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 477 | isa = XCConfigurationList; 478 | buildConfigurations = ( 479 | 97C147031CF9000F007C117D /* Debug */, 480 | 97C147041CF9000F007C117D /* Release */, 481 | ); 482 | defaultConfigurationIsVisible = 0; 483 | defaultConfigurationName = Release; 484 | }; 485 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 486 | isa = XCConfigurationList; 487 | buildConfigurations = ( 488 | 97C147061CF9000F007C117D /* Debug */, 489 | 97C147071CF9000F007C117D /* Release */, 490 | ); 491 | defaultConfigurationIsVisible = 0; 492 | defaultConfigurationName = Release; 493 | }; 494 | /* End XCConfigurationList section */ 495 | }; 496 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 497 | } 498 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | zendesk_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | 4 | import 'package:flutter/material.dart'; 5 | import 'package:zendesk/zendesk.dart'; 6 | 7 | void main() => runApp(new MyApp()); 8 | 9 | const ZendeskAccountKey = ''; 10 | 11 | class MyApp extends StatefulWidget { 12 | @override 13 | _MyAppState createState() => new _MyAppState(); 14 | } 15 | 16 | class _MyAppState extends State { 17 | final Zendesk zendesk = Zendesk(); 18 | 19 | @override 20 | void initState() { 21 | super.initState(); 22 | initZendesk(); 23 | } 24 | 25 | // Zendesk is asynchronous, so we initialize in an async method. 26 | Future initZendesk() async { 27 | zendesk.init(ZendeskAccountKey).then((r) { 28 | print('init finished'); 29 | }).catchError((e) { 30 | print('failed with error $e'); 31 | }); 32 | 33 | // If the widget was removed from the tree while the asynchronous platform 34 | // message was in flight, we want to discard the reply rather than calling 35 | // setState to update our non-existent appearance. 36 | if (!mounted) return; 37 | 38 | // But we aren't calling setState, so the above point is rather moot now. 39 | } 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | return MaterialApp( 44 | home: Scaffold( 45 | appBar: AppBar( 46 | title: Text('Plugin example app'), 47 | ), 48 | body: Center( 49 | child: Column( 50 | children: [ 51 | RaisedButton( 52 | child: Text('Set User Info'), 53 | onPressed: () async { 54 | zendesk 55 | .setVisitorInfo( 56 | name: 'My Name', 57 | phoneNumber: '323-555-1212', 58 | ) 59 | .then((r) { 60 | print('setVisitorInfo finished'); 61 | }).catchError((e) { 62 | print('error $e'); 63 | }); 64 | }, 65 | ), 66 | if (Platform.isIOS) 67 | RaisedButton( 68 | child: Text('Start Chat (styled)'), 69 | onPressed: () async { 70 | zendesk 71 | .startChat( 72 | iosNavigationBarColor: Colors.red, 73 | iosNavigationTitleColor: Colors.yellow, 74 | ) 75 | .then((r) { 76 | print('startChat finished'); 77 | }).catchError((e) { 78 | print('error $e'); 79 | }); 80 | }, 81 | ), 82 | RaisedButton( 83 | child: Text('Add Tags [a,b,c]'), 84 | onPressed: () async { 85 | zendesk.addVisitorTags(['a', 'b', 'c']).then((_) { 86 | print('addTags Finished'); 87 | }).catchError((e) { 88 | print('error $e'); 89 | }); 90 | }, 91 | ), 92 | RaisedButton( 93 | child: Text('Remove Tags [b,c]'), 94 | onPressed: () async { 95 | zendesk.removeVisitorTags(['b', 'c']).then((_) { 96 | print('removeTags Finished'); 97 | }).catchError((e) { 98 | print('error $e'); 99 | }); 100 | }, 101 | ), 102 | RaisedButton( 103 | child: Text('Start Chat'), 104 | onPressed: () async { 105 | zendesk.startChat().then((r) { 106 | print('startChat finished'); 107 | }).catchError((e) { 108 | print('error $e'); 109 | }); 110 | }, 111 | ), 112 | ], 113 | ), 114 | ), 115 | ), 116 | ); 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: zendesk_example 2 | description: Demonstrates how to use the zendesk plugin. 3 | 4 | environment: 5 | sdk: '>=2.10.0 <3.0.0' 6 | 7 | # The following defines the version and build number for your application. 8 | # A version number is three numbers separated by dots, like 1.2.43 9 | # followed by an optional build number separated by a +. 10 | # Both the version and the builder number may be overridden in flutter 11 | # build by specifying --build-name and --build-number, respectively. 12 | # Read more about versioning at semver.org. 13 | version: 1.0.0+1 14 | 15 | dependencies: 16 | flutter: 17 | sdk: flutter 18 | 19 | dev_dependencies: 20 | flutter_test: 21 | sdk: flutter 22 | integration_test: 23 | sdk: flutter 24 | 25 | zendesk: 26 | path: ../ 27 | 28 | # For information on the generic Dart part of this file, see the 29 | # following page: https://www.dartlang.org/tools/pub/pubspec 30 | 31 | # The following section is specific to Flutter. 32 | flutter: 33 | 34 | # The following line ensures that the Material Icons font is 35 | # included with your application, so that you can use the icons in 36 | # the material Icons class. 37 | uses-material-design: true 38 | 39 | # To add assets to your application, add an assets section, like this: 40 | # assets: 41 | # - images/a_dot_burr.jpeg 42 | # - images/a_dot_ham.jpeg 43 | 44 | # An image asset can refer to one or more resolution-specific "variants", see 45 | # https://flutter.io/assets-and-images/#resolution-aware. 46 | 47 | # For details regarding adding assets from package dependencies, see 48 | # https://flutter.io/assets-and-images/#from-packages 49 | 50 | # To add custom fonts to your application, add a fonts section here, 51 | # in this "flutter" section. Each entry in this list should have a 52 | # "family" key with the font family name, and a "fonts" key with a 53 | # list giving the asset and other descriptors for the font. For 54 | # example: 55 | # fonts: 56 | # - family: Schyler 57 | # fonts: 58 | # - asset: fonts/Schyler-Regular.ttf 59 | # - asset: fonts/Schyler-Italic.ttf 60 | # style: italic 61 | # - family: Trajan Pro 62 | # fonts: 63 | # - asset: fonts/TrajanPro.ttf 64 | # - asset: fonts/TrajanPro_Bold.ttf 65 | # weight: 700 66 | # 67 | # For details regarding fonts from package dependencies, 68 | # see https://flutter.io/custom-fonts/#from-packages 69 | -------------------------------------------------------------------------------- /example/test_driver/integration_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:integration_test/integration_test_driver.dart'; 4 | 5 | Future main() => integrationDriver(); 6 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emostar/flutter-zendesk/654966a988b0d5fa1d339e20436d8269766e2332/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/ZendeskPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "zendesk.pigeon.h" 3 | 4 | @interface ZendeskPlugin : NSObject 5 | @end 6 | -------------------------------------------------------------------------------- /ios/Classes/ZendeskPlugin.m: -------------------------------------------------------------------------------- 1 | #import "ZendeskPlugin.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #import "zendesk.pigeon.h" 8 | 9 | #define ARGB_COLOR(c) [UIColor colorWithRed:((c>>16)&0xFF)/255.0 green:((c>>8)&0xFF)/255.0 blue:((c)&0xFF)/255.0 alpha:((c>>24)&0xFF)/255.0] 10 | 11 | @implementation ZendeskPlugin 12 | + (void)registerWithRegistrar:(NSObject*)registrar { 13 | ZendeskPlugin* instance = [[ZendeskPlugin alloc] init]; 14 | ChatApiSetup([registrar messenger], instance); 15 | } 16 | 17 | - (id) null:(id)input or:(id)defaultValue { 18 | if (input == nil || [input isEqual:[NSNull null]]) { 19 | return defaultValue; 20 | } else { 21 | return input; 22 | } 23 | } 24 | 25 | - (void)close:(id)sender { 26 | [[UIApplication sharedApplication].keyWindow.rootViewController dismissViewControllerAnimated:true completion:nil]; 27 | } 28 | 29 | - (void)initialize:(nonnull InitializeRequest *)input error:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { 30 | [ZDKChat initializeWithAccountKey:input.accountKey queue:dispatch_get_main_queue()]; 31 | } 32 | 33 | - (void)setDepartment:(nonnull SetDepartmentRequest *)input error:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { 34 | ZDKChat.instance.configuration.department = input.department; 35 | } 36 | 37 | - (void)startChat:(nonnull StartChatRequest *)input error:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { 38 | NSNumber *navigationBarColor = input.iosNavigationBarColor; 39 | NSNumber *navigationTitleColor = input.iosNavigationTitleColor; 40 | 41 | NSString *backButtonTitle = [self null:input.iosBackButtonTitle 42 | or:NSLocalizedString(@"Back", "")]; 43 | NSString *messagingName = [self null:input.messagingName or:@"Chat Bot"]; 44 | 45 | ZDKMessagingConfiguration *messagingConfiguration = [[ZDKMessagingConfiguration alloc] init]; 46 | messagingConfiguration.name = messagingName; 47 | 48 | ZDKChatConfiguration *chatConfiguration = [[ZDKChatConfiguration alloc] init]; 49 | 50 | chatConfiguration.isPreChatFormEnabled = [[self null:input.isPreChatFormEnabled 51 | or:@(chatConfiguration.isPreChatFormEnabled)] boolValue]; 52 | chatConfiguration.isOfflineFormEnabled = [[self null:input.isOfflineFormEnabled 53 | or:@(chatConfiguration.isOfflineFormEnabled)] boolValue]; 54 | chatConfiguration.isAgentAvailabilityEnabled = [[self null:input.isAgentAvailabilityEnabled 55 | or:@(chatConfiguration.isAgentAvailabilityEnabled)] boolValue]; 56 | chatConfiguration.isChatTranscriptPromptEnabled = [[self null:input.isChatTranscriptPromptEnabled 57 | or:@(chatConfiguration.isChatTranscriptPromptEnabled)] boolValue]; 58 | 59 | NSError *localError = nil; 60 | 61 | NSArray *engines = @[ 62 | (id ) [ZDKChatEngine engineAndReturnError:&localError] 63 | ]; 64 | UIViewController *viewController = [ZDKMessaging.instance buildUIWithEngines:engines 65 | configs:@[messagingConfiguration, chatConfiguration] 66 | error:&localError]; 67 | 68 | UINavigationController *navVc = [[UINavigationController alloc] initWithRootViewController:viewController]; 69 | navVc.navigationBar.translucent = NO; 70 | if (navigationBarColor != nil) { 71 | navVc.navigationBar.barTintColor = ARGB_COLOR([navigationBarColor integerValue]); 72 | } 73 | 74 | if (navigationTitleColor != nil) { 75 | navVc.navigationBar.titleTextAttributes = @{ 76 | NSForegroundColorAttributeName: ARGB_COLOR([navigationTitleColor integerValue]) 77 | }; 78 | } 79 | 80 | 81 | UIViewController *rootVc = [UIApplication sharedApplication].keyWindow.rootViewController ; 82 | [rootVc presentViewController:navVc 83 | animated:true 84 | completion:^{ 85 | UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithTitle:backButtonTitle 86 | style:UIBarButtonItemStylePlain 87 | target:self 88 | action:@selector(close:)]; 89 | if (navigationTitleColor != nil) { 90 | [back setTitleTextAttributes:@{ NSForegroundColorAttributeName:ARGB_COLOR([navigationTitleColor integerValue])} forState:UIControlStateNormal]; 91 | } 92 | 93 | navVc.topViewController.navigationItem.leftBarButtonItem = back; 94 | }]; 95 | 96 | } 97 | 98 | - (void)addVisitorTags:(nonnull VisitorTagsRequest *)input error:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { 99 | [ZDKChat.instance.profileProvider addTags:input.tags completion:nil]; 100 | } 101 | 102 | - (void)appendVisitorNote:(nonnull VisitorNoteRequest *)input error:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { 103 | [ZDKChat.instance.profileProvider appendNote:input.note completion:nil]; 104 | } 105 | 106 | - (void)clearVisitorNotes:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { 107 | [ZDKChat.instance.profileProvider setNote:@"" completion:nil]; 108 | } 109 | 110 | - (void)removeVisitorTags:(nonnull VisitorTagsRequest *)input error:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { 111 | [ZDKChat.instance.profileProvider removeTags:input.tags completion:nil]; 112 | } 113 | 114 | - (void)setVisitorInfo:(nonnull SetVisitorInfoRequest *)input error:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { 115 | ZDKChatAPIConfiguration *chatAPIConfiguration = [[ZDKChatAPIConfiguration alloc] init]; 116 | chatAPIConfiguration.visitorInfo = [[ZDKVisitorInfo alloc] initWithName:input.name 117 | email:input.email 118 | phoneNumber:input.phoneNumber]; 119 | ZDKChat.instance.configuration = chatAPIConfiguration; 120 | } 121 | 122 | - (void)setVisitorNote:(nonnull VisitorNoteRequest *)input error:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { 123 | [ZDKChat.instance.profileProvider setNote:input.note completion:nil]; 124 | } 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /ios/Classes/zendesk.pigeon.h: -------------------------------------------------------------------------------- 1 | // Autogenerated from Pigeon (v0.2.1), do not edit directly. 2 | // See also: https://pub.dev/packages/pigeon 3 | #import 4 | @protocol FlutterBinaryMessenger; 5 | @class FlutterError; 6 | @class FlutterStandardTypedData; 7 | 8 | NS_ASSUME_NONNULL_BEGIN 9 | 10 | @class InitializeRequest; 11 | @class SetDepartmentRequest; 12 | @class StartChatRequest; 13 | @class SetVisitorInfoRequest; 14 | @class VisitorTagsRequest; 15 | @class VisitorNoteRequest; 16 | 17 | @interface InitializeRequest : NSObject 18 | @property(nonatomic, copy, nullable) NSString * accountKey; 19 | @property(nonatomic, copy, nullable) NSString * appId; 20 | @end 21 | 22 | @interface SetDepartmentRequest : NSObject 23 | @property(nonatomic, copy, nullable) NSString * department; 24 | @end 25 | 26 | @interface StartChatRequest : NSObject 27 | @property(nonatomic, strong, nullable) NSNumber * isPreChatFormEnabled; 28 | @property(nonatomic, strong, nullable) NSNumber * isOfflineFormEnabled; 29 | @property(nonatomic, strong, nullable) NSNumber * isAgentAvailabilityEnabled; 30 | @property(nonatomic, strong, nullable) NSNumber * isChatTranscriptPromptEnabled; 31 | @property(nonatomic, copy, nullable) NSString * messagingName; 32 | @property(nonatomic, copy, nullable) NSString * iosBackButtonTitle; 33 | @property(nonatomic, strong, nullable) NSNumber * iosNavigationBarColor; 34 | @property(nonatomic, strong, nullable) NSNumber * iosNavigationTitleColor; 35 | @end 36 | 37 | @interface SetVisitorInfoRequest : NSObject 38 | @property(nonatomic, copy, nullable) NSString * name; 39 | @property(nonatomic, copy, nullable) NSString * email; 40 | @property(nonatomic, copy, nullable) NSString * phoneNumber; 41 | @end 42 | 43 | @interface VisitorTagsRequest : NSObject 44 | @property(nonatomic, strong, nullable) NSArray * tags; 45 | @end 46 | 47 | @interface VisitorNoteRequest : NSObject 48 | @property(nonatomic, copy, nullable) NSString * note; 49 | @end 50 | 51 | @protocol ChatApi 52 | -(void)initialize:(InitializeRequest*)input error:(FlutterError *_Nullable *_Nonnull)error; 53 | -(void)setDepartment:(SetDepartmentRequest*)input error:(FlutterError *_Nullable *_Nonnull)error; 54 | -(void)startChat:(StartChatRequest*)input error:(FlutterError *_Nullable *_Nonnull)error; 55 | @end 56 | 57 | extern void ChatApiSetup(id binaryMessenger, id _Nullable api); 58 | 59 | @protocol ProfileApi 60 | -(void)setVisitorInfo:(SetVisitorInfoRequest*)input error:(FlutterError *_Nullable *_Nonnull)error; 61 | -(void)addVisitorTags:(VisitorTagsRequest*)input error:(FlutterError *_Nullable *_Nonnull)error; 62 | -(void)removeVisitorTags:(VisitorTagsRequest*)input error:(FlutterError *_Nullable *_Nonnull)error; 63 | -(void)setVisitorNote:(VisitorNoteRequest*)input error:(FlutterError *_Nullable *_Nonnull)error; 64 | -(void)appendVisitorNote:(VisitorNoteRequest*)input error:(FlutterError *_Nullable *_Nonnull)error; 65 | -(void)clearVisitorNotes:(FlutterError *_Nullable *_Nonnull)error; 66 | @end 67 | 68 | extern void ProfileApiSetup(id binaryMessenger, id _Nullable api); 69 | 70 | NS_ASSUME_NONNULL_END 71 | -------------------------------------------------------------------------------- /ios/Classes/zendesk.pigeon.m: -------------------------------------------------------------------------------- 1 | // Autogenerated from Pigeon (v0.2.1), do not edit directly. 2 | // See also: https://pub.dev/packages/pigeon 3 | #import "zendesk.pigeon.h" 4 | #import 5 | 6 | #if !__has_feature(objc_arc) 7 | #error File requires ARC to be enabled. 8 | #endif 9 | 10 | static NSDictionary* wrapResult(NSDictionary *result, FlutterError *error) { 11 | NSDictionary *errorDict = (NSDictionary *)[NSNull null]; 12 | if (error) { 13 | errorDict = @{ 14 | @"code": (error.code ? error.code : [NSNull null]), 15 | @"message": (error.message ? error.message : [NSNull null]), 16 | @"details": (error.details ? error.details : [NSNull null]), 17 | }; 18 | } 19 | return @{ 20 | @"result": (result ? result : [NSNull null]), 21 | @"error": errorDict, 22 | }; 23 | } 24 | 25 | @interface InitializeRequest () 26 | +(InitializeRequest*)fromMap:(NSDictionary*)dict; 27 | -(NSDictionary*)toMap; 28 | @end 29 | @interface SetDepartmentRequest () 30 | +(SetDepartmentRequest*)fromMap:(NSDictionary*)dict; 31 | -(NSDictionary*)toMap; 32 | @end 33 | @interface StartChatRequest () 34 | +(StartChatRequest*)fromMap:(NSDictionary*)dict; 35 | -(NSDictionary*)toMap; 36 | @end 37 | @interface SetVisitorInfoRequest () 38 | +(SetVisitorInfoRequest*)fromMap:(NSDictionary*)dict; 39 | -(NSDictionary*)toMap; 40 | @end 41 | @interface VisitorTagsRequest () 42 | +(VisitorTagsRequest*)fromMap:(NSDictionary*)dict; 43 | -(NSDictionary*)toMap; 44 | @end 45 | @interface VisitorNoteRequest () 46 | +(VisitorNoteRequest*)fromMap:(NSDictionary*)dict; 47 | -(NSDictionary*)toMap; 48 | @end 49 | 50 | @implementation InitializeRequest 51 | +(InitializeRequest*)fromMap:(NSDictionary*)dict { 52 | InitializeRequest* result = [[InitializeRequest alloc] init]; 53 | result.accountKey = dict[@"accountKey"]; 54 | if ((NSNull *)result.accountKey == [NSNull null]) { 55 | result.accountKey = nil; 56 | } 57 | result.appId = dict[@"appId"]; 58 | if ((NSNull *)result.appId == [NSNull null]) { 59 | result.appId = nil; 60 | } 61 | return result; 62 | } 63 | -(NSDictionary*)toMap { 64 | return [NSDictionary dictionaryWithObjectsAndKeys:(self.accountKey ? self.accountKey : [NSNull null]), @"accountKey", (self.appId ? self.appId : [NSNull null]), @"appId", nil]; 65 | } 66 | @end 67 | 68 | @implementation SetDepartmentRequest 69 | +(SetDepartmentRequest*)fromMap:(NSDictionary*)dict { 70 | SetDepartmentRequest* result = [[SetDepartmentRequest alloc] init]; 71 | result.department = dict[@"department"]; 72 | if ((NSNull *)result.department == [NSNull null]) { 73 | result.department = nil; 74 | } 75 | return result; 76 | } 77 | -(NSDictionary*)toMap { 78 | return [NSDictionary dictionaryWithObjectsAndKeys:(self.department ? self.department : [NSNull null]), @"department", nil]; 79 | } 80 | @end 81 | 82 | @implementation StartChatRequest 83 | +(StartChatRequest*)fromMap:(NSDictionary*)dict { 84 | StartChatRequest* result = [[StartChatRequest alloc] init]; 85 | result.isPreChatFormEnabled = dict[@"isPreChatFormEnabled"]; 86 | if ((NSNull *)result.isPreChatFormEnabled == [NSNull null]) { 87 | result.isPreChatFormEnabled = nil; 88 | } 89 | result.isOfflineFormEnabled = dict[@"isOfflineFormEnabled"]; 90 | if ((NSNull *)result.isOfflineFormEnabled == [NSNull null]) { 91 | result.isOfflineFormEnabled = nil; 92 | } 93 | result.isAgentAvailabilityEnabled = dict[@"isAgentAvailabilityEnabled"]; 94 | if ((NSNull *)result.isAgentAvailabilityEnabled == [NSNull null]) { 95 | result.isAgentAvailabilityEnabled = nil; 96 | } 97 | result.isChatTranscriptPromptEnabled = dict[@"isChatTranscriptPromptEnabled"]; 98 | if ((NSNull *)result.isChatTranscriptPromptEnabled == [NSNull null]) { 99 | result.isChatTranscriptPromptEnabled = nil; 100 | } 101 | result.messagingName = dict[@"messagingName"]; 102 | if ((NSNull *)result.messagingName == [NSNull null]) { 103 | result.messagingName = nil; 104 | } 105 | result.iosBackButtonTitle = dict[@"iosBackButtonTitle"]; 106 | if ((NSNull *)result.iosBackButtonTitle == [NSNull null]) { 107 | result.iosBackButtonTitle = nil; 108 | } 109 | result.iosNavigationBarColor = dict[@"iosNavigationBarColor"]; 110 | if ((NSNull *)result.iosNavigationBarColor == [NSNull null]) { 111 | result.iosNavigationBarColor = nil; 112 | } 113 | result.iosNavigationTitleColor = dict[@"iosNavigationTitleColor"]; 114 | if ((NSNull *)result.iosNavigationTitleColor == [NSNull null]) { 115 | result.iosNavigationTitleColor = nil; 116 | } 117 | return result; 118 | } 119 | -(NSDictionary*)toMap { 120 | return [NSDictionary dictionaryWithObjectsAndKeys:(self.isPreChatFormEnabled ? self.isPreChatFormEnabled : [NSNull null]), @"isPreChatFormEnabled", (self.isOfflineFormEnabled ? self.isOfflineFormEnabled : [NSNull null]), @"isOfflineFormEnabled", (self.isAgentAvailabilityEnabled ? self.isAgentAvailabilityEnabled : [NSNull null]), @"isAgentAvailabilityEnabled", (self.isChatTranscriptPromptEnabled ? self.isChatTranscriptPromptEnabled : [NSNull null]), @"isChatTranscriptPromptEnabled", (self.messagingName ? self.messagingName : [NSNull null]), @"messagingName", (self.iosBackButtonTitle ? self.iosBackButtonTitle : [NSNull null]), @"iosBackButtonTitle", (self.iosNavigationBarColor ? self.iosNavigationBarColor : [NSNull null]), @"iosNavigationBarColor", (self.iosNavigationTitleColor ? self.iosNavigationTitleColor : [NSNull null]), @"iosNavigationTitleColor", nil]; 121 | } 122 | @end 123 | 124 | @implementation SetVisitorInfoRequest 125 | +(SetVisitorInfoRequest*)fromMap:(NSDictionary*)dict { 126 | SetVisitorInfoRequest* result = [[SetVisitorInfoRequest alloc] init]; 127 | result.name = dict[@"name"]; 128 | if ((NSNull *)result.name == [NSNull null]) { 129 | result.name = nil; 130 | } 131 | result.email = dict[@"email"]; 132 | if ((NSNull *)result.email == [NSNull null]) { 133 | result.email = nil; 134 | } 135 | result.phoneNumber = dict[@"phoneNumber"]; 136 | if ((NSNull *)result.phoneNumber == [NSNull null]) { 137 | result.phoneNumber = nil; 138 | } 139 | return result; 140 | } 141 | -(NSDictionary*)toMap { 142 | return [NSDictionary dictionaryWithObjectsAndKeys:(self.name ? self.name : [NSNull null]), @"name", (self.email ? self.email : [NSNull null]), @"email", (self.phoneNumber ? self.phoneNumber : [NSNull null]), @"phoneNumber", nil]; 143 | } 144 | @end 145 | 146 | @implementation VisitorTagsRequest 147 | +(VisitorTagsRequest*)fromMap:(NSDictionary*)dict { 148 | VisitorTagsRequest* result = [[VisitorTagsRequest alloc] init]; 149 | result.tags = dict[@"tags"]; 150 | if ((NSNull *)result.tags == [NSNull null]) { 151 | result.tags = nil; 152 | } 153 | return result; 154 | } 155 | -(NSDictionary*)toMap { 156 | return [NSDictionary dictionaryWithObjectsAndKeys:(self.tags ? self.tags : [NSNull null]), @"tags", nil]; 157 | } 158 | @end 159 | 160 | @implementation VisitorNoteRequest 161 | +(VisitorNoteRequest*)fromMap:(NSDictionary*)dict { 162 | VisitorNoteRequest* result = [[VisitorNoteRequest alloc] init]; 163 | result.note = dict[@"note"]; 164 | if ((NSNull *)result.note == [NSNull null]) { 165 | result.note = nil; 166 | } 167 | return result; 168 | } 169 | -(NSDictionary*)toMap { 170 | return [NSDictionary dictionaryWithObjectsAndKeys:(self.note ? self.note : [NSNull null]), @"note", nil]; 171 | } 172 | @end 173 | 174 | void ChatApiSetup(id binaryMessenger, id api) { 175 | { 176 | FlutterBasicMessageChannel *channel = 177 | [FlutterBasicMessageChannel 178 | messageChannelWithName:@"dev.flutter.pigeon.ChatApi.initialize" 179 | binaryMessenger:binaryMessenger]; 180 | if (api) { 181 | [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { 182 | InitializeRequest *input = [InitializeRequest fromMap:message]; 183 | FlutterError *error; 184 | [api initialize:input error:&error]; 185 | callback(wrapResult(nil, error)); 186 | }]; 187 | } 188 | else { 189 | [channel setMessageHandler:nil]; 190 | } 191 | } 192 | { 193 | FlutterBasicMessageChannel *channel = 194 | [FlutterBasicMessageChannel 195 | messageChannelWithName:@"dev.flutter.pigeon.ChatApi.setDepartment" 196 | binaryMessenger:binaryMessenger]; 197 | if (api) { 198 | [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { 199 | SetDepartmentRequest *input = [SetDepartmentRequest fromMap:message]; 200 | FlutterError *error; 201 | [api setDepartment:input error:&error]; 202 | callback(wrapResult(nil, error)); 203 | }]; 204 | } 205 | else { 206 | [channel setMessageHandler:nil]; 207 | } 208 | } 209 | { 210 | FlutterBasicMessageChannel *channel = 211 | [FlutterBasicMessageChannel 212 | messageChannelWithName:@"dev.flutter.pigeon.ChatApi.startChat" 213 | binaryMessenger:binaryMessenger]; 214 | if (api) { 215 | [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { 216 | StartChatRequest *input = [StartChatRequest fromMap:message]; 217 | FlutterError *error; 218 | [api startChat:input error:&error]; 219 | callback(wrapResult(nil, error)); 220 | }]; 221 | } 222 | else { 223 | [channel setMessageHandler:nil]; 224 | } 225 | } 226 | } 227 | void ProfileApiSetup(id binaryMessenger, id api) { 228 | { 229 | FlutterBasicMessageChannel *channel = 230 | [FlutterBasicMessageChannel 231 | messageChannelWithName:@"dev.flutter.pigeon.ProfileApi.setVisitorInfo" 232 | binaryMessenger:binaryMessenger]; 233 | if (api) { 234 | [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { 235 | SetVisitorInfoRequest *input = [SetVisitorInfoRequest fromMap:message]; 236 | FlutterError *error; 237 | [api setVisitorInfo:input error:&error]; 238 | callback(wrapResult(nil, error)); 239 | }]; 240 | } 241 | else { 242 | [channel setMessageHandler:nil]; 243 | } 244 | } 245 | { 246 | FlutterBasicMessageChannel *channel = 247 | [FlutterBasicMessageChannel 248 | messageChannelWithName:@"dev.flutter.pigeon.ProfileApi.addVisitorTags" 249 | binaryMessenger:binaryMessenger]; 250 | if (api) { 251 | [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { 252 | VisitorTagsRequest *input = [VisitorTagsRequest fromMap:message]; 253 | FlutterError *error; 254 | [api addVisitorTags:input error:&error]; 255 | callback(wrapResult(nil, error)); 256 | }]; 257 | } 258 | else { 259 | [channel setMessageHandler:nil]; 260 | } 261 | } 262 | { 263 | FlutterBasicMessageChannel *channel = 264 | [FlutterBasicMessageChannel 265 | messageChannelWithName:@"dev.flutter.pigeon.ProfileApi.removeVisitorTags" 266 | binaryMessenger:binaryMessenger]; 267 | if (api) { 268 | [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { 269 | VisitorTagsRequest *input = [VisitorTagsRequest fromMap:message]; 270 | FlutterError *error; 271 | [api removeVisitorTags:input error:&error]; 272 | callback(wrapResult(nil, error)); 273 | }]; 274 | } 275 | else { 276 | [channel setMessageHandler:nil]; 277 | } 278 | } 279 | { 280 | FlutterBasicMessageChannel *channel = 281 | [FlutterBasicMessageChannel 282 | messageChannelWithName:@"dev.flutter.pigeon.ProfileApi.setVisitorNote" 283 | binaryMessenger:binaryMessenger]; 284 | if (api) { 285 | [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { 286 | VisitorNoteRequest *input = [VisitorNoteRequest fromMap:message]; 287 | FlutterError *error; 288 | [api setVisitorNote:input error:&error]; 289 | callback(wrapResult(nil, error)); 290 | }]; 291 | } 292 | else { 293 | [channel setMessageHandler:nil]; 294 | } 295 | } 296 | { 297 | FlutterBasicMessageChannel *channel = 298 | [FlutterBasicMessageChannel 299 | messageChannelWithName:@"dev.flutter.pigeon.ProfileApi.appendVisitorNote" 300 | binaryMessenger:binaryMessenger]; 301 | if (api) { 302 | [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { 303 | VisitorNoteRequest *input = [VisitorNoteRequest fromMap:message]; 304 | FlutterError *error; 305 | [api appendVisitorNote:input error:&error]; 306 | callback(wrapResult(nil, error)); 307 | }]; 308 | } 309 | else { 310 | [channel setMessageHandler:nil]; 311 | } 312 | } 313 | { 314 | FlutterBasicMessageChannel *channel = 315 | [FlutterBasicMessageChannel 316 | messageChannelWithName:@"dev.flutter.pigeon.ProfileApi.clearVisitorNotes" 317 | binaryMessenger:binaryMessenger]; 318 | if (api) { 319 | [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { 320 | FlutterError *error; 321 | [api clearVisitorNotes:&error]; 322 | callback(wrapResult(nil, error)); 323 | }]; 324 | } 325 | else { 326 | [channel setMessageHandler:nil]; 327 | } 328 | } 329 | } 330 | -------------------------------------------------------------------------------- /ios/zendesk.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'zendesk' 6 | s.version = '0.0.1' 7 | s.summary = 'Flutter interface for Zendesk Mobile SDK' 8 | s.description = <<-DESC 9 | Flutter interface for Zendesk Mobile SDK 10 | DESC 11 | s.homepage = 'https://github.com/emostar/flutter-zendesk' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'Codehead Labs' => 'oss@codeheadlabs.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/**/*.h' 17 | s.dependency 'Flutter' 18 | s.dependency 'ZendeskChatSDK' 19 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } 20 | 21 | s.ios.deployment_target = '10.0' 22 | end 23 | 24 | -------------------------------------------------------------------------------- /lib/src/pigeon.dart: -------------------------------------------------------------------------------- 1 | // Autogenerated from Pigeon (v0.2.1), do not edit directly. 2 | // See also: https://pub.dev/packages/pigeon 3 | // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types 4 | // @dart = 2.12 5 | import 'dart:async'; 6 | import 'dart:typed_data' show Uint8List, Int32List, Int64List, Float64List; 7 | 8 | import 'package:flutter/services.dart'; 9 | 10 | class InitializeRequest { 11 | String? accountKey; 12 | String? appId; 13 | 14 | Object encode() { 15 | final Map pigeonMap = {}; 16 | pigeonMap['accountKey'] = accountKey; 17 | pigeonMap['appId'] = appId; 18 | return pigeonMap; 19 | } 20 | 21 | static InitializeRequest decode(Object message) { 22 | final Map pigeonMap = message as Map; 23 | return InitializeRequest() 24 | ..accountKey = pigeonMap['accountKey'] as String? 25 | ..appId = pigeonMap['appId'] as String?; 26 | } 27 | } 28 | 29 | class SetDepartmentRequest { 30 | String? department; 31 | 32 | Object encode() { 33 | final Map pigeonMap = {}; 34 | pigeonMap['department'] = department; 35 | return pigeonMap; 36 | } 37 | 38 | static SetDepartmentRequest decode(Object message) { 39 | final Map pigeonMap = message as Map; 40 | return SetDepartmentRequest() 41 | ..department = pigeonMap['department'] as String?; 42 | } 43 | } 44 | 45 | class StartChatRequest { 46 | bool? isPreChatFormEnabled; 47 | bool? isOfflineFormEnabled; 48 | bool? isAgentAvailabilityEnabled; 49 | bool? isChatTranscriptPromptEnabled; 50 | String? messagingName; 51 | String? iosBackButtonTitle; 52 | int? iosNavigationBarColor; 53 | int? iosNavigationTitleColor; 54 | 55 | Object encode() { 56 | final Map pigeonMap = {}; 57 | pigeonMap['isPreChatFormEnabled'] = isPreChatFormEnabled; 58 | pigeonMap['isOfflineFormEnabled'] = isOfflineFormEnabled; 59 | pigeonMap['isAgentAvailabilityEnabled'] = isAgentAvailabilityEnabled; 60 | pigeonMap['isChatTranscriptPromptEnabled'] = isChatTranscriptPromptEnabled; 61 | pigeonMap['messagingName'] = messagingName; 62 | pigeonMap['iosBackButtonTitle'] = iosBackButtonTitle; 63 | pigeonMap['iosNavigationBarColor'] = iosNavigationBarColor; 64 | pigeonMap['iosNavigationTitleColor'] = iosNavigationTitleColor; 65 | return pigeonMap; 66 | } 67 | 68 | static StartChatRequest decode(Object message) { 69 | final Map pigeonMap = message as Map; 70 | return StartChatRequest() 71 | ..isPreChatFormEnabled = pigeonMap['isPreChatFormEnabled'] as bool? 72 | ..isOfflineFormEnabled = pigeonMap['isOfflineFormEnabled'] as bool? 73 | ..isAgentAvailabilityEnabled = pigeonMap['isAgentAvailabilityEnabled'] as bool? 74 | ..isChatTranscriptPromptEnabled = pigeonMap['isChatTranscriptPromptEnabled'] as bool? 75 | ..messagingName = pigeonMap['messagingName'] as String? 76 | ..iosBackButtonTitle = pigeonMap['iosBackButtonTitle'] as String? 77 | ..iosNavigationBarColor = pigeonMap['iosNavigationBarColor'] as int? 78 | ..iosNavigationTitleColor = pigeonMap['iosNavigationTitleColor'] as int?; 79 | } 80 | } 81 | 82 | class SetVisitorInfoRequest { 83 | String? name; 84 | String? email; 85 | String? phoneNumber; 86 | 87 | Object encode() { 88 | final Map pigeonMap = {}; 89 | pigeonMap['name'] = name; 90 | pigeonMap['email'] = email; 91 | pigeonMap['phoneNumber'] = phoneNumber; 92 | return pigeonMap; 93 | } 94 | 95 | static SetVisitorInfoRequest decode(Object message) { 96 | final Map pigeonMap = message as Map; 97 | return SetVisitorInfoRequest() 98 | ..name = pigeonMap['name'] as String? 99 | ..email = pigeonMap['email'] as String? 100 | ..phoneNumber = pigeonMap['phoneNumber'] as String?; 101 | } 102 | } 103 | 104 | class VisitorTagsRequest { 105 | List? tags; 106 | 107 | Object encode() { 108 | final Map pigeonMap = {}; 109 | pigeonMap['tags'] = tags; 110 | return pigeonMap; 111 | } 112 | 113 | static VisitorTagsRequest decode(Object message) { 114 | final Map pigeonMap = message as Map; 115 | return VisitorTagsRequest() 116 | ..tags = pigeonMap['tags'] as List?; 117 | } 118 | } 119 | 120 | class VisitorNoteRequest { 121 | String? note; 122 | 123 | Object encode() { 124 | final Map pigeonMap = {}; 125 | pigeonMap['note'] = note; 126 | return pigeonMap; 127 | } 128 | 129 | static VisitorNoteRequest decode(Object message) { 130 | final Map pigeonMap = message as Map; 131 | return VisitorNoteRequest() 132 | ..note = pigeonMap['note'] as String?; 133 | } 134 | } 135 | 136 | class ChatApi { 137 | /// Constructor for [ChatApi]. The [binaryMessenger] named argument is 138 | /// available for dependency injection. If it is left null, the default 139 | /// BinaryMessenger will be used which routes to the host platform. 140 | ChatApi({BinaryMessenger? binaryMessenger}) : _binaryMessenger = binaryMessenger; 141 | 142 | final BinaryMessenger? _binaryMessenger; 143 | 144 | Future initialize(InitializeRequest arg) async { 145 | final Object encoded = arg.encode(); 146 | final BasicMessageChannel channel = BasicMessageChannel( 147 | 'dev.flutter.pigeon.ChatApi.initialize', const StandardMessageCodec(), binaryMessenger: _binaryMessenger); 148 | final Map? replyMap = 149 | await channel.send(encoded) as Map?; 150 | if (replyMap == null) { 151 | throw PlatformException( 152 | code: 'channel-error', 153 | message: 'Unable to establish connection on channel.', 154 | details: null, 155 | ); 156 | } else if (replyMap['error'] != null) { 157 | final Map error = (replyMap['error'] as Map?)!; 158 | throw PlatformException( 159 | code: (error['code'] as String?)!, 160 | message: error['message'] as String?, 161 | details: error['details'], 162 | ); 163 | } else { 164 | // noop 165 | } 166 | } 167 | 168 | Future setDepartment(SetDepartmentRequest arg) async { 169 | final Object encoded = arg.encode(); 170 | final BasicMessageChannel channel = BasicMessageChannel( 171 | 'dev.flutter.pigeon.ChatApi.setDepartment', const StandardMessageCodec(), binaryMessenger: _binaryMessenger); 172 | final Map? replyMap = 173 | await channel.send(encoded) as Map?; 174 | if (replyMap == null) { 175 | throw PlatformException( 176 | code: 'channel-error', 177 | message: 'Unable to establish connection on channel.', 178 | details: null, 179 | ); 180 | } else if (replyMap['error'] != null) { 181 | final Map error = (replyMap['error'] as Map?)!; 182 | throw PlatformException( 183 | code: (error['code'] as String?)!, 184 | message: error['message'] as String?, 185 | details: error['details'], 186 | ); 187 | } else { 188 | // noop 189 | } 190 | } 191 | 192 | Future startChat(StartChatRequest arg) async { 193 | final Object encoded = arg.encode(); 194 | final BasicMessageChannel channel = BasicMessageChannel( 195 | 'dev.flutter.pigeon.ChatApi.startChat', const StandardMessageCodec(), binaryMessenger: _binaryMessenger); 196 | final Map? replyMap = 197 | await channel.send(encoded) as Map?; 198 | if (replyMap == null) { 199 | throw PlatformException( 200 | code: 'channel-error', 201 | message: 'Unable to establish connection on channel.', 202 | details: null, 203 | ); 204 | } else if (replyMap['error'] != null) { 205 | final Map error = (replyMap['error'] as Map?)!; 206 | throw PlatformException( 207 | code: (error['code'] as String?)!, 208 | message: error['message'] as String?, 209 | details: error['details'], 210 | ); 211 | } else { 212 | // noop 213 | } 214 | } 215 | } 216 | 217 | class ProfileApi { 218 | /// Constructor for [ProfileApi]. The [binaryMessenger] named argument is 219 | /// available for dependency injection. If it is left null, the default 220 | /// BinaryMessenger will be used which routes to the host platform. 221 | ProfileApi({BinaryMessenger? binaryMessenger}) : _binaryMessenger = binaryMessenger; 222 | 223 | final BinaryMessenger? _binaryMessenger; 224 | 225 | Future setVisitorInfo(SetVisitorInfoRequest arg) async { 226 | final Object encoded = arg.encode(); 227 | final BasicMessageChannel channel = BasicMessageChannel( 228 | 'dev.flutter.pigeon.ProfileApi.setVisitorInfo', const StandardMessageCodec(), binaryMessenger: _binaryMessenger); 229 | final Map? replyMap = 230 | await channel.send(encoded) as Map?; 231 | if (replyMap == null) { 232 | throw PlatformException( 233 | code: 'channel-error', 234 | message: 'Unable to establish connection on channel.', 235 | details: null, 236 | ); 237 | } else if (replyMap['error'] != null) { 238 | final Map error = (replyMap['error'] as Map?)!; 239 | throw PlatformException( 240 | code: (error['code'] as String?)!, 241 | message: error['message'] as String?, 242 | details: error['details'], 243 | ); 244 | } else { 245 | // noop 246 | } 247 | } 248 | 249 | Future addVisitorTags(VisitorTagsRequest arg) async { 250 | final Object encoded = arg.encode(); 251 | final BasicMessageChannel channel = BasicMessageChannel( 252 | 'dev.flutter.pigeon.ProfileApi.addVisitorTags', const StandardMessageCodec(), binaryMessenger: _binaryMessenger); 253 | final Map? replyMap = 254 | await channel.send(encoded) as Map?; 255 | if (replyMap == null) { 256 | throw PlatformException( 257 | code: 'channel-error', 258 | message: 'Unable to establish connection on channel.', 259 | details: null, 260 | ); 261 | } else if (replyMap['error'] != null) { 262 | final Map error = (replyMap['error'] as Map?)!; 263 | throw PlatformException( 264 | code: (error['code'] as String?)!, 265 | message: error['message'] as String?, 266 | details: error['details'], 267 | ); 268 | } else { 269 | // noop 270 | } 271 | } 272 | 273 | Future removeVisitorTags(VisitorTagsRequest arg) async { 274 | final Object encoded = arg.encode(); 275 | final BasicMessageChannel channel = BasicMessageChannel( 276 | 'dev.flutter.pigeon.ProfileApi.removeVisitorTags', const StandardMessageCodec(), binaryMessenger: _binaryMessenger); 277 | final Map? replyMap = 278 | await channel.send(encoded) as Map?; 279 | if (replyMap == null) { 280 | throw PlatformException( 281 | code: 'channel-error', 282 | message: 'Unable to establish connection on channel.', 283 | details: null, 284 | ); 285 | } else if (replyMap['error'] != null) { 286 | final Map error = (replyMap['error'] as Map?)!; 287 | throw PlatformException( 288 | code: (error['code'] as String?)!, 289 | message: error['message'] as String?, 290 | details: error['details'], 291 | ); 292 | } else { 293 | // noop 294 | } 295 | } 296 | 297 | Future setVisitorNote(VisitorNoteRequest arg) async { 298 | final Object encoded = arg.encode(); 299 | final BasicMessageChannel channel = BasicMessageChannel( 300 | 'dev.flutter.pigeon.ProfileApi.setVisitorNote', const StandardMessageCodec(), binaryMessenger: _binaryMessenger); 301 | final Map? replyMap = 302 | await channel.send(encoded) as Map?; 303 | if (replyMap == null) { 304 | throw PlatformException( 305 | code: 'channel-error', 306 | message: 'Unable to establish connection on channel.', 307 | details: null, 308 | ); 309 | } else if (replyMap['error'] != null) { 310 | final Map error = (replyMap['error'] as Map?)!; 311 | throw PlatformException( 312 | code: (error['code'] as String?)!, 313 | message: error['message'] as String?, 314 | details: error['details'], 315 | ); 316 | } else { 317 | // noop 318 | } 319 | } 320 | 321 | Future appendVisitorNote(VisitorNoteRequest arg) async { 322 | final Object encoded = arg.encode(); 323 | final BasicMessageChannel channel = BasicMessageChannel( 324 | 'dev.flutter.pigeon.ProfileApi.appendVisitorNote', const StandardMessageCodec(), binaryMessenger: _binaryMessenger); 325 | final Map? replyMap = 326 | await channel.send(encoded) as Map?; 327 | if (replyMap == null) { 328 | throw PlatformException( 329 | code: 'channel-error', 330 | message: 'Unable to establish connection on channel.', 331 | details: null, 332 | ); 333 | } else if (replyMap['error'] != null) { 334 | final Map error = (replyMap['error'] as Map?)!; 335 | throw PlatformException( 336 | code: (error['code'] as String?)!, 337 | message: error['message'] as String?, 338 | details: error['details'], 339 | ); 340 | } else { 341 | // noop 342 | } 343 | } 344 | 345 | Future clearVisitorNotes() async { 346 | final BasicMessageChannel channel = BasicMessageChannel( 347 | 'dev.flutter.pigeon.ProfileApi.clearVisitorNotes', const StandardMessageCodec(), binaryMessenger: _binaryMessenger); 348 | final Map? replyMap = 349 | await channel.send(null) as Map?; 350 | if (replyMap == null) { 351 | throw PlatformException( 352 | code: 'channel-error', 353 | message: 'Unable to establish connection on channel.', 354 | details: null, 355 | ); 356 | } else if (replyMap['error'] != null) { 357 | final Map error = (replyMap['error'] as Map?)!; 358 | throw PlatformException( 359 | code: (error['code'] as String?)!, 360 | message: error['message'] as String?, 361 | details: error['details'], 362 | ); 363 | } else { 364 | // noop 365 | } 366 | } 367 | } 368 | -------------------------------------------------------------------------------- /lib/src/zendesk.dart: -------------------------------------------------------------------------------- 1 | part of zendesk; 2 | 3 | class Zendesk { 4 | final ChatApi _chatApi = ChatApi(); 5 | final ProfileApi _profileApi = ProfileApi(); 6 | 7 | Future init(String accountKey, {String? appId}) async { 8 | InitializeRequest request = InitializeRequest() 9 | ..accountKey = accountKey 10 | ..appId = appId; 11 | 12 | await _chatApi.initialize(request); 13 | } 14 | 15 | Future setDepartment(String department) async { 16 | SetDepartmentRequest request = SetDepartmentRequest() 17 | ..department = department; 18 | 19 | await _chatApi.setDepartment(request); 20 | } 21 | 22 | Future setVisitorInfo({ 23 | String? name, 24 | String? email, 25 | String? phoneNumber, 26 | }) async { 27 | SetVisitorInfoRequest request = SetVisitorInfoRequest() 28 | ..name = name 29 | ..email = email 30 | ..phoneNumber = phoneNumber; 31 | 32 | await _profileApi.setVisitorInfo(request); 33 | } 34 | 35 | Future addVisitorTags(List tags) async { 36 | VisitorTagsRequest request = VisitorTagsRequest()..tags = tags; 37 | await _profileApi.addVisitorTags(request); 38 | } 39 | 40 | Future removeVisitorTags(List tags) async { 41 | VisitorTagsRequest request = VisitorTagsRequest()..tags = tags; 42 | await _profileApi.removeVisitorTags(request); 43 | } 44 | 45 | Future setVisitorNote(String note) async { 46 | VisitorNoteRequest request = VisitorNoteRequest()..note = note; 47 | await _profileApi.setVisitorNote(request); 48 | } 49 | 50 | Future appendVisitorNote(String note) async { 51 | VisitorNoteRequest request = VisitorNoteRequest()..note = note; 52 | await _profileApi.appendVisitorNote(request); 53 | } 54 | 55 | Future clearVisitorNotes() async { 56 | await _profileApi.clearVisitorNotes(); 57 | } 58 | 59 | Future startChat({ 60 | bool? isPreChatFormEnabled, 61 | bool? isOfflineFormEnabled, 62 | bool? isAgentAvailabilityEnabled, 63 | bool? isChatTranscriptPromptEnabled, 64 | String? messagingName, 65 | String? iosBackButtonTitle, 66 | Color? iosNavigationBarColor, 67 | Color? iosNavigationTitleColor, 68 | }) async { 69 | StartChatRequest request = StartChatRequest() 70 | ..isPreChatFormEnabled = isPreChatFormEnabled 71 | ..isOfflineFormEnabled = isOfflineFormEnabled 72 | ..isAgentAvailabilityEnabled = isAgentAvailabilityEnabled 73 | ..isChatTranscriptPromptEnabled = isChatTranscriptPromptEnabled 74 | ..messagingName = messagingName 75 | ..iosBackButtonTitle = iosBackButtonTitle 76 | ..iosNavigationBarColor = iosNavigationBarColor?.value 77 | ..iosNavigationTitleColor = iosNavigationTitleColor?.value; 78 | 79 | await _chatApi.startChat(request); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /lib/zendesk.dart: -------------------------------------------------------------------------------- 1 | library zendesk; 2 | 3 | import 'dart:async'; 4 | import 'dart:ui'; 5 | 6 | import 'package:flutter/services.dart'; 7 | 8 | import 'src/pigeon.dart'; 9 | 10 | part 'src/zendesk.dart'; 11 | -------------------------------------------------------------------------------- /pigeons/zendesk.dart: -------------------------------------------------------------------------------- 1 | import 'package:pigeon/pigeon.dart'; 2 | 3 | class InitializeRequest { 4 | String? accountKey; 5 | String? appId; 6 | } 7 | 8 | class SetDepartmentRequest { 9 | String? department; 10 | } 11 | 12 | class StartChatRequest { 13 | bool? isPreChatFormEnabled; 14 | bool? isOfflineFormEnabled; 15 | bool? isAgentAvailabilityEnabled; 16 | bool? isChatTranscriptPromptEnabled; 17 | String? messagingName; 18 | String? iosBackButtonTitle; 19 | int? iosNavigationBarColor; 20 | int? iosNavigationTitleColor; 21 | } 22 | 23 | @HostApi() 24 | abstract class ChatApi { 25 | void initialize(InitializeRequest request); 26 | void setDepartment(SetDepartmentRequest request); 27 | void startChat(StartChatRequest request); 28 | } 29 | 30 | class SetVisitorInfoRequest { 31 | String? name; 32 | String? email; 33 | String? phoneNumber; 34 | } 35 | 36 | class VisitorTagsRequest { 37 | List? tags; 38 | } 39 | 40 | class VisitorNoteRequest { 41 | String? note; 42 | } 43 | 44 | @HostApi() 45 | abstract class ProfileApi { 46 | void setVisitorInfo(SetVisitorInfoRequest request); 47 | void addVisitorTags(VisitorTagsRequest request); 48 | void removeVisitorTags(VisitorTagsRequest request); 49 | void setVisitorNote(VisitorNoteRequest request); 50 | void appendVisitorNote(VisitorNoteRequest request); 51 | void clearVisitorNotes(); 52 | } 53 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: zendesk 2 | description: Flutter interface for Zendesk Mobile SDK 3 | version: 2.0.1 4 | homepage: https://github.com/emostar/flutter-zendesk 5 | 6 | dependencies: 7 | flutter: 8 | sdk: flutter 9 | 10 | dev_dependencies: 11 | flutter_test: 12 | sdk: flutter 13 | integration_test: 14 | sdk: flutter 15 | pigeon: ^0.2.1 16 | 17 | flutter: 18 | plugin: 19 | platforms: 20 | android: 21 | package: com.codeheadlabs.zendesk 22 | pluginClass: ZendeskPlugin 23 | ios: 24 | pluginClass: ZendeskPlugin 25 | 26 | environment: 27 | sdk: '>=2.12.0 <3.0.0' --------------------------------------------------------------------------------