-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.DS_Store | ||
.dart_tool/ | ||
|
||
.packages | ||
.pub/ | ||
|
||
build/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: 8962f6dc68ec8e2206ac2fa874da4a453856c7d3 | ||
channel: stable | ||
|
||
project_type: plugin |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 0.0.1 | ||
|
||
* First release. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# desk_zoho_chat | ||
|
||
A flutter implementation of desk.zoho.com In-app support. You need desk.zoho.com widget code to use this plugin | ||
|
||
|
||
Screenshots | ||
 | ||
|
||
|
||
## Getting Started | ||
copy the your appId from the generated code gotten from desk.zoho.com dashboard | ||
|
||
This plugin is depended on [InappWebView!](https://pub.dev/packages/flutter_inappwebview) so you'll need to set the necessary permissions | ||
|
||
For Android, in your Manifest.xml add : | ||
``` | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
``` | ||
|
||
``` | ||
<application | ||
android:label="desk_zoho_chat_example" | ||
android:icon="@mipmap/ic_launcher" | ||
android:usesCleartextTraffic="true"> //add this line | ||
``` | ||
|
||
|
||
|
||
For iOS, in your Info.plist add: | ||
|
||
``` | ||
<key>NSAppTransportSecurity</key> | ||
<dict> | ||
<key>NSAllowsArbitraryLoads</key> | ||
<true/> | ||
<key>NSAllowsArbitraryLoadsInWebContent</key> | ||
<true/> | ||
</dict> | ||
<key>NSAllowsLocalNetworking</key> | ||
<true/> | ||
<key>NSAllowsArbitraryLoadsInWebContent</key> | ||
<true/> | ||
``` | ||
|
||
|
||
Get Your AppID From the desk.zoho.com | ||
Assuming the widget code here is ** xxxxx **, copy it and use desk_desk_zoho_chat this way | ||
|
||
``` | ||
DeskZohoChat( | ||
zohoAppID: "xxxxx", //desk.zoho.com chat widget code | ||
preloaderSize: 100.0, //preloader size | ||
preloaderWidth: 3, //preloader border size | ||
preloaderColorHexString: "#2196f3", //preloader color code | ||
) | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
group 'com.whitecoode.desk_zoho_chat' | ||
version '1.0-SNAPSHOT' | ||
|
||
buildscript { | ||
ext.kotlin_version = '1.5.20' | ||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:4.1.0' | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
} | ||
} | ||
|
||
rootProject.allprojects { | ||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.library' | ||
apply plugin: 'kotlin-android' | ||
|
||
android { | ||
compileSdkVersion 30 | ||
|
||
sourceSets { | ||
main.java.srcDirs += 'src/main/kotlin' | ||
} | ||
defaultConfig { | ||
minSdkVersion 17 | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
org.gradle.jvmargs=-Xmx1536M | ||
android.useAndroidX=true | ||
android.enableJetifier=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = 'desk_zoho_chat' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.whitecoode.desk_zoho_chat"> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.whitecoode.desk_zoho_chat | ||
|
||
import androidx.annotation.NonNull | ||
|
||
import io.flutter.embedding.engine.plugins.FlutterPlugin | ||
import io.flutter.plugin.common.MethodCall | ||
import io.flutter.plugin.common.MethodChannel | ||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler | ||
import io.flutter.plugin.common.MethodChannel.Result | ||
import io.flutter.plugin.common.PluginRegistry.Registrar | ||
|
||
/** DeskZohoChatPlugin */ | ||
class DeskZohoChatPlugin: FlutterPlugin, MethodCallHandler { | ||
/// The MethodChannel that will the communication between Flutter and native Android | ||
/// | ||
/// This local reference serves to register the plugin with the Flutter Engine and unregister it | ||
/// when the Flutter Engine is detached from the Activity | ||
private lateinit var channel : MethodChannel | ||
|
||
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { | ||
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "desk_zoho_chat") | ||
channel.setMethodCallHandler(this) | ||
} | ||
|
||
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { | ||
if (call.method == "getPlatformVersion") { | ||
result.success("Android ${android.os.Build.VERSION.RELEASE}") | ||
} else { | ||
result.notImplemented() | ||
} | ||
} | ||
|
||
override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { | ||
channel.setMethodCallHandler(null) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" /> | ||
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" /> | ||
<excludeFolder url="file://$MODULE_DIR$/.idea" /> | ||
<excludeFolder url="file://$MODULE_DIR$/.pub" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build" /> | ||
<excludeFolder url="file://$MODULE_DIR$/example/.dart_tool" /> | ||
<excludeFolder url="file://$MODULE_DIR$/example/.pub" /> | ||
<excludeFolder url="file://$MODULE_DIR$/example/build" /> | ||
</content> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" name="Dart SDK" level="project" /> | ||
<orderEntry type="library" name="Flutter Plugins" level="project" /> | ||
</component> | ||
</module> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.idea/ | ||
.vagrant/ | ||
.sconsign.dblite | ||
.svn/ | ||
|
||
.DS_Store | ||
*.swp | ||
profile | ||
|
||
DerivedData/ | ||
build/ | ||
GeneratedPluginRegistrant.h | ||
GeneratedPluginRegistrant.m | ||
|
||
.generated/ | ||
|
||
*.pbxuser | ||
*.mode1v3 | ||
*.mode2v3 | ||
*.perspectivev3 | ||
|
||
!default.pbxuser | ||
!default.mode1v3 | ||
!default.mode2v3 | ||
!default.perspectivev3 | ||
|
||
xcuserdata | ||
|
||
*.moved-aside | ||
|
||
*.pyc | ||
*sync/ | ||
Icon? | ||
.tags* | ||
|
||
/Flutter/Generated.xcconfig | ||
/Flutter/flutter_export_environment.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#import <Flutter/Flutter.h> | ||
|
||
@interface DeskZohoChatPlugin : NSObject<FlutterPlugin> | ||
@end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#import "DeskZohoChatPlugin.h" | ||
#if __has_include(<desk_zoho_chat/desk_zoho_chat-Swift.h>) | ||
#import <desk_zoho_chat/desk_zoho_chat-Swift.h> | ||
#else | ||
// Support project import fallback if the generated compatibility header | ||
// is not copied when this plugin is created as a library. | ||
// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 | ||
#import "desk_zoho_chat-Swift.h" | ||
#endif | ||
|
||
@implementation DeskZohoChatPlugin | ||
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar { | ||
[SwiftDeskZohoChatPlugin registerWithRegistrar:registrar]; | ||
} | ||
@end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Flutter | ||
import UIKit | ||
|
||
public class SwiftDeskZohoChatPlugin: NSObject, FlutterPlugin { | ||
public static func register(with registrar: FlutterPluginRegistrar) { | ||
let channel = FlutterMethodChannel(name: "desk_zoho_chat", binaryMessenger: registrar.messenger()) | ||
let instance = SwiftDeskZohoChatPlugin() | ||
registrar.addMethodCallDelegate(instance, channel: channel) | ||
} | ||
|
||
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { | ||
result("iOS " + UIDevice.current.systemVersion) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. | ||
# Run `pod lib lint desk_zoho_chat.podspec` to validate before publishing. | ||
# | ||
Pod::Spec.new do |s| | ||
s.name = 'desk_zoho_chat' | ||
s.version = '0.0.1' | ||
s.summary = 'A new flutter plugin project.' | ||
s.description = <<-DESC | ||
A new flutter plugin project. | ||
DESC | ||
s.homepage = 'http://example.com' | ||
s.license = { :file => '../LICENSE' } | ||
s.author = { 'Your Company' => '[email protected]' } | ||
s.source = { :path => '.' } | ||
s.source_files = 'Classes/**/*' | ||
s.dependency 'Flutter' | ||
s.platform = :ios, '8.0' | ||
|
||
# Flutter.framework does not contain a i386 slice. | ||
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } | ||
s.swift_version = '5.0' | ||
end |