Commit 2f7abd9a authored by jz's avatar jz

update

parent 426def2a
......@@ -61,11 +61,11 @@
6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
73587ABC77058C5C2D7A1CAF /* GMShareSDK.podspec */ = {isa = PBXFileReference; includeInIndex = 1; name = GMShareSDK.podspec; path = ../GMShareSDK.podspec; sourceTree = "<group>"; };
7B345725C8E08530D8EDB12A /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
73587ABC77058C5C2D7A1CAF /* GMShareSDK.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = GMShareSDK.podspec; path = ../GMShareSDK.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
7B345725C8E08530D8EDB12A /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
B0EC0126CB08246293DA5519 /* Pods-GMShareSDK_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GMShareSDK_Example.debug.xcconfig"; path = "Target Support Files/Pods-GMShareSDK_Example/Pods-GMShareSDK_Example.debug.xcconfig"; sourceTree = "<group>"; };
CB31F369DA0CC8DE5739239C /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; name = README.md; path = ../README.md; sourceTree = "<group>"; };
CB31F369DA0CC8DE5739239C /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
DB21F612ECB7A93A9931CD51 /* Pods_GMShareSDK_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GMShareSDK_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
......@@ -193,7 +193,6 @@
5EFECF96C065D7562836F22B /* Pods-GMShareSDK_Tests.debug.xcconfig */,
035B645BC46FB80B490A9FBE /* Pods-GMShareSDK_Tests.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
......@@ -258,6 +257,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
......
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:GMShareSDK.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
PODS:
- GMShareSDK (0.1.0)
DEPENDENCIES:
- GMShareSDK (from `../`)
EXTERNAL SOURCES:
GMShareSDK:
:path: "../"
SPEC CHECKSUMS:
GMShareSDK: 2c3a3b816eae7ca8614333605a5c0615321c7215
PODFILE CHECKSUM: 9ff4536b9b3f79ff5f4703b2beaf332c9d475030
COCOAPODS: 1.7.4
{
"name": "GMShareSDK",
"version": "0.1.0",
"summary": "A short description of GMShareSDK.",
"description": "TODO: Add long description of the pod here.",
"homepage": "https://github.com/Q14/GMShareSDK",
"license": {
"type": "MIT",
"file": "LICENSE"
},
"authors": {
"Q14": "qiaojinzhu@igengmei.com"
},
"source": {
"git": "https://github.com/Q14/GMShareSDK.git",
"tag": "0.1.0"
},
"platforms": {
"ios": "8.0"
},
"source_files": "GMShareSDK/Classes/**/*"
}
PODS:
- GMShareSDK (0.1.0)
DEPENDENCIES:
- GMShareSDK (from `../`)
EXTERNAL SOURCES:
GMShareSDK:
:path: "../"
SPEC CHECKSUMS:
GMShareSDK: 2c3a3b816eae7ca8614333605a5c0615321c7215
PODFILE CHECKSUM: 9ff4536b9b3f79ff5f4703b2beaf332c9d475030
COCOAPODS: 1.7.4
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
#import <Foundation/Foundation.h>
@interface PodsDummy_GMShareSDK : NSObject
@end
@implementation PodsDummy_GMShareSDK
@end
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "WMShareObject.h"
#import "GMShareSDK.h"
#import "GMThirdPartyDefine.h"
#import "GMThirdPartyLoginHelper.h"
#import "GMThirdPartyOauthManager.h"
#import "NSMutableDictionary+GMShareSDK.h"
#import "NSURLRequest+IgnoreSSL.h"
#import "QQApiInterface.h"
#import "QQApiInterfaceObject.h"
#import "sdkdef.h"
#import "TencentOAuth.h"
#import "GMPopupBgView.h"
#import "GMSafeValue.h"
#import "UIImage+Compress.h"
#import "UIView+SafeArea.h"
FOUNDATION_EXPORT double GMShareSDKVersionNumber;
FOUNDATION_EXPORT const unsigned char GMShareSDKVersionString[];
framework module GMShareSDK {
umbrella header "GMShareSDK-umbrella.h"
export *
module * { export * }
}
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/GMShareSDK
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
# Acknowledgements
This application makes use of the following third party libraries:
## GMShareSDK
Copyright (c) 2019 Q14 <qiaojinzhu@igengmei.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Generated by CocoaPods - https://cocoapods.org
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>FooterText</key>
<string>This application makes use of the following third party libraries:</string>
<key>Title</key>
<string>Acknowledgements</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2019 Q14 &lt;qiaojinzhu@igengmei.com&gt;
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
</string>
<key>License</key>
<string>MIT</string>
<key>Title</key>
<string>GMShareSDK</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Generated by CocoaPods - https://cocoapods.org</string>
<key>Title</key>
<string></string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
</array>
<key>StringsTable</key>
<string>Acknowledgements</string>
<key>Title</key>
<string>Acknowledgements</string>
</dict>
</plist>
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods_GMShareSDK_Example : NSObject
@end
@implementation PodsDummy_Pods_GMShareSDK_Example
@end
#!/bin/sh
set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the script phase was successful).
exit 0
fi
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# Used as a return value for each invocation of `strip_invalid_archs` function.
STRIP_BINARY_RETVAL=0
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
# Copies and strips a vendored framework
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRODUCTS_DIR}/$1"
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elif [ -r "$1" ]; then
local source="$1"
fi
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# Use filter instead of exclude so missing patterns don't throw errors.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
elif [ -L "${binary}" ]; then
echo "Destination binary is symlinked..."
dirname="$(dirname "${binary}")"
binary="${dirname}/$(readlink "${binary}")"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
strip_invalid_archs "$binary"
fi
# Resign the code if required by the build settings to avoid unstable apps
code_sign_if_enabled "${destination}/$(basename "$1")"
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u)
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
fi
}
# Copies and strips a vendored dSYM
install_dsym() {
local source="$1"
if [ -r "$source" ]; then
# Copy the dSYM into a the targets temp dir.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
local basename
basename="$(basename -s .framework.dSYM "$source")"
binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then
strip_invalid_archs "$binary"
fi
if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
# Move the stripped file into its final destination.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
else
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
fi
fi
}
# Copies the bcsymbolmap files of a vendored framework
install_bcsymbolmap() {
local bcsymbolmap_path="$1"
local destination="${BUILT_PRODUCTS_DIR}"
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"
}
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identity
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
code_sign_cmd="$code_sign_cmd &"
fi
echo "$code_sign_cmd"
eval "$code_sign_cmd"
fi
}
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current target binary
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
# Intersect them with the architectures we are building for
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
# If there are no archs supported by this binary then warn the user
if [[ -z "$intersected_archs" ]]; then
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
STRIP_BINARY_RETVAL=0
return
fi
stripped=""
for arch in $binary_archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary"
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
STRIP_BINARY_RETVAL=1
}
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/GMShareSDK/GMShareSDK.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/GMShareSDK/GMShareSDK.framework"
fi
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
wait
fi
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double Pods_GMShareSDK_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_GMShareSDK_ExampleVersionString[];
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GMShareSDK"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GMShareSDK/GMShareSDK.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_LDFLAGS = $(inherited) -framework "GMShareSDK"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
framework module Pods_GMShareSDK_Example {
umbrella header "Pods-GMShareSDK_Example-umbrella.h"
export *
module * { export * }
}
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GMShareSDK"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GMShareSDK/GMShareSDK.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_LDFLAGS = $(inherited) -framework "GMShareSDK"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
# Acknowledgements
This application makes use of the following third party libraries:
Generated by CocoaPods - https://cocoapods.org
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>FooterText</key>
<string>This application makes use of the following third party libraries:</string>
<key>Title</key>
<string>Acknowledgements</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Generated by CocoaPods - https://cocoapods.org</string>
<key>Title</key>
<string></string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
</array>
<key>StringsTable</key>
<string>Acknowledgements</string>
<key>Title</key>
<string>Acknowledgements</string>
</dict>
</plist>
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods_GMShareSDK_Tests : NSObject
@end
@implementation PodsDummy_Pods_GMShareSDK_Tests
@end
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double Pods_GMShareSDK_TestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_GMShareSDK_TestsVersionString[];
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GMShareSDK"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GMShareSDK/GMShareSDK.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "GMShareSDK"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
framework module Pods_GMShareSDK_Tests {
umbrella header "Pods-GMShareSDK_Tests-umbrella.h"
export *
module * { export * }
}
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GMShareSDK"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GMShareSDK/GMShareSDK.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "GMShareSDK"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
//
// WMShareObject.h
// Gengmei
//
// Created by Sean Lee on 7/22/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import <GMBase/GMObject.h>
@protocol WMShareBasicObject @end
@interface WMShareBasicObject : GMObject
@property (nonatomic,strong) NSString * title;
@property (nonatomic,strong) NSString * content;
@end
@protocol GMWechatminiObject @end
@interface GMWechatminiObject : GMObject
@property (nonatomic,strong) NSString * desc;
@property (nonatomic,strong) NSString * title;
@property (nonatomic,strong) NSString * hdImageUrl;
@property (nonatomic,strong) NSString * path;
@property (nonatomic,strong) NSString * userName;
@property (nonatomic,strong) NSString * thumbImageUrl;
@end
@protocol WMShareObject @end
@interface WMShareObject : GMObject
@property (nonatomic,strong) NSString * image;
@property (nonatomic,strong) NSString * url;
@property (nonatomic,strong) NSString * from;
@property (nonatomic,strong) NSString * showPrice;
@property (nonatomic,strong) NSString * organizationName;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* wechat;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* wechatline;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* wechatScreenshot;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* wechatlineScreenshot;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* qq;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* qqzone;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* weibo;
@property (nonatomic,strong) GMWechatminiObject <GMWechatminiObject>* wechatmini;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* douyin; // 分享到抖音 扫脸1.5
@property (nonatomic, copy) NSString *page_name;// 埋点使用
@property (nonatomic, copy) NSString *business_id;// 埋点使用
@property (nonatomic, copy) NSString *is_like;//埋点使用
@property (nonatomic, copy) NSString *videoUrl;//视频URL(分享视频时)扫脸1.5
@end
@protocol GMDiaryShareObject @end
@interface GMDiaryShareObject : GMObject
@property (nonatomic,strong) NSString *id;
@property (nonatomic,strong) NSString *title;
@property (nonatomic,strong) WMShareObject *shareData;
@end
@protocol GMShareConfigObject @end
@interface GMShareConfigObject : GMObject
@property (nonatomic,strong) NSString *hideCopyLink;
@property (nonatomic,strong) NSString *hideRefresh;
@property (nonatomic,strong) NSString *hideReport;
@property (nonatomic,strong) NSString *shareCallback;
@property (nonatomic,strong) NSString *shareTip;
@property (nonatomic,strong) NSString *shareTitle;
@property (nonatomic,strong) NSString *shareInfo;
@property (nonatomic, copy) NSString *taskType;
@property (nonatomic, copy) NSString *isReportShareResult;
@end
//
// WMShareObject.m
// Gengmei
//
// Created by Sean Lee on 7/22/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import "WMShareObject.h"
@implementation WMShareBasicObject
@end
@implementation GMWechatminiObject
@end
@implementation WMShareObject
@end
@implementation GMDiaryShareObject
@end
@implementation GMShareConfigObject
@end
//
// GMShareSDK.h
// Gengmei
//
// Created by licong on 2017/8/16.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "NSMutableDictionary+GMShareSDK.h"
/**
* 分享内容状态变更回调处理器
*
* @param state 状态
* @param userData 附加数据, 返回状态以外的一些数据描述,如:邮件分享取消时,标识是否保存草稿等
* @param error 错误信息,当且仅当state为SSDKResponseStateFail时返回
*/
typedef void(^GMSDKShareStateChangedHandler) (GMShareResponseState state, NSError *error);
@interface GMShareSDK : NSObject
+ (instancetype)shareInstance;
/** 判断微博、微信、QQ是否已经安装*/
+ (BOOL)isClientInstalled:(GMSharePlatform)platformType;
+ (UIImage *)compressWithUrl:(NSString *)url;
+ (UIImage *)compressImage:(UIImage *)image;
+ (NSString *)shareChannel:(GMSharePlatform)platformType;
- (void)share:(GMSharePlatform)platformType
parameters:(NSMutableDictionary *)parameters
onStateChanged:(GMSDKShareStateChangedHandler)stateChangedHandler;
- (void)shareImage:(UIImage *)image platform:(GMSharePlatform)platformType;
@end
This diff is collapsed.
//
// GMThirdPartyDefine.h
// Gengmei
//
// Created by licong on 2017/8/2.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#ifndef GMThirdPartyDefine_h
#define GMThirdPartyDefine_h
typedef NS_ENUM(NSInteger, GMShareResponseState) {
GMShareResponseStateBegin = -1,
GMShareResponseStateSuccess = 0,
GMShareResponseStateFail = 1,
GMShareResponseStateCancel = 2,
GMShareResponseStateBack = 3,
};
typedef NS_ENUM(NSInteger, GMSharePlatform) {
GMSharePlatformUnknown = -1,
GMSharePlatformSinaWeibo = 0, /**< 新浪微博 */
GMSharePlatformQQSpace = 1, /**< QQ空间 */
GMSharePlatformQQFriend = 2, /**< QQ好友 */
GMSharePlatformWechatSession = 3, /**< 微信好友 */
GMSharePlatformWechatTimeline = 4, /**< 微信朋友圈 */
GMSharePlatformFav = 5, /**< 收藏 */
GMSharePlatformDelete = 6, /**< 删除 */
GMSharePlatformCopyLink = 7, /**< 复制链接 */
GMSharePlatformRefresh = 8, /**< 刷新 */
GMSharePlatformReport = 9, /**< 举报 */
GMSharePlatformCancelFollow = 10, /**< 圈子取消关注 */
GMSharePlatformWechatSessionSnapShot = 11, /**< 微信好友快照 */
GMSharePlatformWechatTimelineSnapShot = 12, /**< 微信朋友圈快照 */
GMSharePlatformWechatMiniProgram = 13, /**< 微信小程序分享 */
GMSharePlatformPrivateMsg = 14, /**< 更美私信 */
GMSharePlatformInviteAnswer = 15, /** 邀请回复(回复详情和问题详情界面) */
GMSharePlatformWechat = 100, /**< 微信平台*/
GMSharePlatformQQ = 101, /**< QQ平台*/
GMSharePlatformDouyin = 102, /**< 抖音*/
};
/**
* 内容类型
*/
typedef NS_ENUM(NSUInteger, GMShareContentType){
/**
* 自动适配类型,视传入的参数来决定
*/
GMShareContentTypeAuto = 0,
/**
* 文本
*/
GMShareContentTypeText = 1,
/**
* 图片
*/
GMShareContentTypeImage = 2,
/**
* 网页
*/
GMShareContentTypeWebPage = 3,
/**
* 应用
*/
GMShareContentTypeApp = 4,
/**
* 音频
*/
GMShareContentTypeAudio = 5,
/**
* 视频
*/
GMShareContentTypeVideo = 6,
/**
* 文件类型(暂时仅微信可用)
*/
GMShareContentTypeFile = 7,
//图片类型 仅FacebookMessage 分享图片并需要明确结果时 注此类型分享后不会显示应用名称与icon
//v3.6.2 增加
GMShareContentTypeFBMessageImages = 8,
//图片类型 仅FacebookMessage 分享视频并需要明确结果时 注此类型分享后不会显示应用名称与icon
//所分享的视频地址必须为相册地址
//v3.6.2 增加
GMShareContentTypeFBMessageVideo = 9,
//3.6.3 小程序分享(暂时仅微信可用)
GMShareContentTypeMiniProgram = 10
};
#define kQQLogin @"kQQLogin"
#define kSinaLogin @"kSinaLogin"
#define kWechatLogin @"kWechatLogin"
//QQ好友和朋友圈会掉的url完全一样,所以没必要区分 QQ41A1DB6D://response_from_qq?source=qq&source_scheme=mqqapi&error=0&version=1&sdkv=3.1
#define kQQShare @"kQQShare"
#define kSinaShare @"kSinaShare"
#define kWechatShare @"kWechatShare"
#define kDouyinShare @"kDouyinShare"
#define kThirdPartyLoginBack @"kThirdPartyLoginBack"
#define kThirdPartyShareBack @"kThirdPartyShareBack"
#define WEICHAT_BASE_URL @"https://api.weixin.qq.com/sns"
//有关登陆授权的一些key
#ifdef APPSTORE
#define WEIXIN_APPID @"wx4326da3ad2429149" //WeiXin appId
#define WEIXIN_SECRET @"971147c78f55c3a657394a7a31f4266a" //WeiXin secret
#else
#define WEIXIN_APPID @"wx403cd28c142c7d87" //WeiXin appId
#define WEIXIN_SECRET @"035af39ad74bbc01b7517a291c836827" //WeiXin secret
#endif
#define QQ_APPID @"1101126509" //QQ APPID
#define QQ_HEX_APPID @"41A1DB6D" //16进制的QQ appid
#define QQ_APPKEY @"yD4Eu3WZX6egmrMU" //QQ APPKEY
#define SINAWEIBO_APPID @"2387882244" //Sina Weibo APPKEY
#define SINAWEIBO_APPKEY @"8480ee24118f0dec4f71e0ca1ba8638e" //Sina Weibo secret
#define SINAWEIBO_REDIRECTURI @"http://www.wanmeizhensuo.com/api/user/weibo/auth/"
#define DOUYIN_APPID @"awedc2tmuly0pozy" //抖音 APPID
#define DOUYIN_APPKEY @"cd39b2610b33244eef66eab3327e4d72" // douyin secret
#define QM_APPID @"4e26f886" //QM APPID
#endif /* GMThirdPartyDefine_h */
//
// GMThirdPartyLoginHelper.h
// Gengmei
//
// Created by licong on 2017/8/2.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "GMThirdPartyDefine.h"
@interface GMThirdPartyUser : NSObject
@property (nonatomic, copy) NSString * nickname;
@property (nonatomic, copy) NSString * uid;
@property (nonatomic, copy) NSString * unionid;
@property (nonatomic, copy) NSString * icon;
@property (nonatomic, copy) NSString * provice;
@property (nonatomic, copy) NSString * city;
@property (nonatomic, assign) GMSharePlatform platformType;
@property (nonatomic, copy) NSString *thirdDetail;
@end
typedef void (^GMThirdPartyUserHandler) (GMShareResponseState state, GMThirdPartyUser *user);
@interface GMThirdPartyLoginHelper : NSObject
+ (void)loginByPlatform:(GMSharePlatform)platform
onUserSync:(GMThirdPartyUserHandler)userHandler;
+ (void)thirdPartyLogout;
@end
//
// GMThirdPartyLoginHelper.m
// Gengmei
//
// Created by licong on 2017/8/2.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import "GMThirdPartyLoginHelper.h"
#import "WXApi.h"
#import <Weibo_SDK/WeiboSDK.h>
#import "GMThirdPartyDefine.h"
#import "GMThirdPartyOauthManager.h"
@implementation GMThirdPartyUser
@end
@implementation GMThirdPartyLoginHelper
+ (void)loginByPlatform:(GMSharePlatform)platform
onUserSync:(GMThirdPartyUserHandler)userHandler{
[GMThirdPartyOauthManager shareInstance].user.platformType = platform;
if (platform == GMSharePlatformQQ) {
NSArray* permissions = [NSArray arrayWithObjects:
kOPEN_PERMISSION_GET_USER_INFO,
kOPEN_PERMISSION_GET_SIMPLE_USER_INFO,
nil];
[[GMThirdPartyOauthManager shareInstance].tencentOAuth setAuthShareType: AuthShareType_QQ];
[[GMThirdPartyOauthManager shareInstance].tencentOAuth authorize:permissions inSafari:NO];
__block id observer = [[NSNotificationCenter defaultCenter] addObserverForName:kQQLogin object:nil queue: [NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) {
GMShareResponseState state = (GMShareResponseState )[note.userInfo[@"state"] integerValue];
userHandler(state, note.object);
[[NSNotificationCenter defaultCenter] removeObserver:observer];
}];
} else if (platform == GMSharePlatformWechat) {
if ([WXApi isWXAppInstalled]){
[GMThirdPartyLoginHelper wechatLogin];
__block id observer = [[NSNotificationCenter defaultCenter] addObserverForName:kWechatLogin object:nil queue: [NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) {
GMShareResponseState state = (GMShareResponseState )[note.userInfo[@"state"] integerValue];
userHandler(state, note.object);
[[NSNotificationCenter defaultCenter] removeObserver:observer];
}];
}
} else if (platform == GMSharePlatformSinaWeibo){
WBAuthorizeRequest *request = [WBAuthorizeRequest request];
request.redirectURI = SINAWEIBO_REDIRECTURI ;
//http://open.weibo.com/wiki/Scope
request.scope = @"all";
request.userInfo = @{@"flag": @"authorize"};
[WeiboSDK sendRequest:request];
__block id observer = [[NSNotificationCenter defaultCenter] addObserverForName:kSinaLogin object:nil queue: [NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) {
GMShareResponseState state = (GMShareResponseState )[note.userInfo[@"state"] integerValue];
userHandler(state, note.object);
[[NSNotificationCenter defaultCenter] removeObserver:observer];
}];
}
}
+ (void)wechatLogin {
if ([WXApi isWXAppInstalled]){
//构造SendAuthReq结构体
SendAuthReq* req = [[SendAuthReq alloc ] init];
req.scope = @"snsapi_userinfo" ;
req.state = @"Gengmei" ;
//第三方向微信终端发送一个SendAuthReq消息结构
[WXApi sendReq:req];
}
}
+ (void)thirdPartyLogout {
if ([GMThirdPartyOauthManager shareInstance].user.platformType == GMSharePlatformQQ){
[GMThirdPartyOauthManager shareInstance].tencentOAuth = [[TencentOAuth alloc] initWithAppId:QQ_APPID andDelegate:[GMThirdPartyOauthManager shareInstance]];
}
}
@end
//
// GMThirdPartyOauthManager.h
// Gengmei
//
// Created by licong on 2017/8/2.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "WeiboSDK.h"
#import "WXApi.h"
#import "GMThirdPartyLoginHelper.h"
#import <TencentOpenAPI/TencentOAuth.h>
#import "DouyinOpenSDKApi.h"
//这里是接受三方授权的回调
@interface GMThirdPartyOauthManager : NSObject<WeiboSDKDelegate, WBHttpRequestDelegate, TencentSessionDelegate, WXApiDelegate, DouyinOpenSDKApiDelegate, DouyinOpenSDKLogDelegate>
@property (nonatomic, strong) GMThirdPartyUser * user;
@property (nonatomic, assign) GMSharePlatform currentShareType;
@property (strong, nonatomic) NSString *wbtoken;
@property (strong, nonatomic) TencentOAuth * tencentOAuth;
+ (instancetype)shareInstance;
@end
This diff is collapsed.
//
// NSMutableDictionary+GMShareSDK.h
// Gengmei
//
// Created by licong on 2017/8/18.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "GMThirdPartyDefine.h"
#import "WXApiObject.h"
@interface NSMutableDictionary (GMShareSDK)
/**
* 设置分享参数
*
* @param text 文本
* @param images 图片集合,传入参数可以为单张图片信息,也可以为一个NSArray,数组元素可以为UIImage、NSString(图片路径)、NSURL(图片路径)、SSDKImage。如: @"http://www.mob.com/images/logo_black.png" 或 @[@"http://www.mob.com/images/logo_black.png"]
* @param url 网页路径/应用路径
* @param title 标题
* @param type 分享类型
*/
- (void)shareSetupShareParamsByText:(NSString *)text
images:(id)images
url:(NSURL *)url
title:(NSString *)title
type:(GMShareContentType)type;
/**
* 设置分享参数
*
* @param text 文本
* @param images 图片集合,传入参数可以为单张图片信息,也可以为一个NSArray,数组元素可以为UIImage、NSString(图片路径)、NSURL(图片路径)、SSDKImage。如: @"http://www.mob.com/images/logo_black.png" 或 @[@"http://www.mob.com/images/logo_black.png"]
* @param url 网页路径/应用路径
* @param title 标题
* @param type 分享类型
* @param videoUrl 视频的URL
*/
- (void)shareSetupShareParamsByText:(NSString *)text
images:(id)images
url:(NSURL *)url
title:(NSString *)title
videoUrl:(NSURL *)videoUrl
type:(GMShareContentType)type;
/**
* 设置微信小程序分享参数
*
* @param text 网页路径/应用路径
* @user name 小程序的原始id
* @user path 小程序页面的路径
* @param title 小程序标题
* @param description 小程序描述
* @param thumbImage 缩略图
* @param hdImageData 小程序节点高清大图,小于128k
*/
- (void)shareSetupMiniProgramShareParamsByUrl:(NSString *)url
userName:(NSString *)userName
path:(NSString *)path
title:(NSString *)title
description:(NSString *)description
thumbImage:(id)thumbImage
hdImageData:(id)hdImageData;
@end
//
// NSMutableDictionary+GMShareSDK.m
// Gengmei
//
// Created by licong on 2017/8/18.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import "NSMutableDictionary+GMShareSDK.h"
@implementation NSMutableDictionary (GMShareSDK)
- (void)shareSetupShareParamsByText:(NSString *)text
images:(id)images
url:(NSURL *)url
title:(NSString *)title
type:(GMShareContentType)type{
self[@"text"] = text;
self[@"images"] = images;
self[@"url"] = url;
self[@"title"] = title;
self[@"type"] = @(type);
}
- (void)shareSetupShareParamsByText:(NSString *)text
images:(id)images
url:(NSURL *)url
title:(NSString *)title
videoUrl:(NSURL *)videoUrl
type:(GMShareContentType)type {
self[@"text"] = text;
self[@"images"] = images;
self[@"url"] = url;
self[@"title"] = title;
self[@"type"] = @(type);
self[@"videoUrl"] = videoUrl;
}
- (void)shareSetupMiniProgramShareParamsByUrl:(NSString *)url
userName:(NSString *)userName
path:(NSString *)path
title:(NSString *)title
description:(NSString *)description
thumbImage:(id)thumbImage
hdImageData:(id)hdImageData{
self[@"url"] = url;
self[@"userName"] = userName;
self[@"path"] = path;
self[@"title"] = title;
self[@"description"] = description;
self[@"thumbImage"] = thumbImage;
self[@"hdImageData"] = hdImageData;
self[@"type"] = @(GMShareContentTypeMiniProgram);
}
@end
//
// NSURLRequest+IgnoreSSL.h
// tencentOAuthDemo
//
// Created by JeaminW on 13-5-20.
//
//
#import <Foundation/Foundation.h>
@interface NSURLRequest (IgnoreSSL)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host;
@end
//
// NSURLRequest+IgnoreSSL.m
// tencentOAuthDemo
//
// Created by JeaminW on 13-5-20.
//
//
#import "NSURLRequest+IgnoreSSL.h"
@implementation NSURLRequest (IgnoreSSL)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
{
return YES;
}
@end
///
/// \file QQApiInterface.h
/// \brief QQApi接口简化封装
///
/// Created by Tencent on 12-5-15.
/// Copyright (c) 2012年 Tencent. All rights reserved.
///
#import <Foundation/Foundation.h>
#import "QQApiInterfaceObject.h"
typedef void (^sendResultBlock)(NSDictionary *result);
/**
\brief 处理来至QQ的请求及响应的回调协议
*/
@protocol QQApiInterfaceDelegate <NSObject>
/**
处理来至QQ的请求
*/
- (void)onReq:(QQBaseReq *)req;
/**
处理来至QQ的响应
*/
- (void)onResp:(QQBaseResp *)resp;
/**
处理QQ在线状态的回调
*/
- (void)isOnlineResponse:(NSDictionary *)response;
@end
/**
\brief 对QQApi的简单封装类
*/
@interface QQApiInterface : NSObject
/**
处理由手Q唤起的普通跳转请求
\param url 待处理的url跳转请求
\param delegate 第三方应用用于处理来至QQ请求及响应的委托对象
\return 跳转请求处理结果,YES表示成功处理,NO表示不支持的请求协议或处理失败
*/
+ (BOOL)handleOpenURL:(NSURL *)url delegate:(id<QQApiInterfaceDelegate>)delegate;
/**
处理由手Q唤起的universallink跳转请求
\param universallink 待处理的universallink跳转请求
\param delegate 第三方应用用于处理来至QQ请求及响应的委托对象
\return 跳转请求处理结果,YES表示成功处理,NO表示不支持的请求协议或处理失败
*/
+ (BOOL)handleOpenUniversallink:(NSURL*)universallink delegate:(id<QQApiInterfaceDelegate>)delegate;
/**
向手Q发起分享请求
\param req 分享内容的请求
\return 请求发送结果码
*/
+ (QQApiSendResultCode)sendReq:(QQBaseReq *)req;
/**
向手Q QZone结合版发起分享请求
\note H5分享只支持单张网络图片的传递
\param req 分享内容的请求
\return 请求发送结果码
*/
+ (QQApiSendResultCode)SendReqToQZone:(QQBaseReq *)req;
/**
向手Q发起设置QQ头像
\param req 分享内容的请求
\return 请求发送结果码
*/
+ (QQApiSendResultCode)sendMessageToQQAvatarWithReq:(QQBaseReq*)req;
/**
向手Q发起组图分享到表情收藏
\param req 分享内容的请求
\return 请求发送结果码
*/
+ (QQApiSendResultCode)sendMessageToFaceCollectionWithReq:(QQBaseReq*)req;
/**
检测是否已安装QQ
\return 如果QQ已安装则返回YES,否则返回NO
\note SDK目前已经支持QQ、TIM授权登录及分享功能, 会按照QQ>TIM的顺序进行调用。
只要用户安装了QQ、TIM中任意一个应用,都可为第三方应用进行授权登录、分享功能。
第三方应用在接入SDK时不需要判断是否安装QQ、TIM。若有判断安装QQ、TIM的逻辑建议移除。
*/
+ (BOOL)isQQInstalled;
/**
检测是否已安装TIM
\return 如果TIM已安装则返回YES,否则返回NO
\note SDK目前已经支持QQ、TIM授权登录及分享功能, 会按照QQ>TIM的顺序进行调用。
只要用户安装了QQ、TIM中任意一个应用,都可为第三方应用进行授权登录、分享功能。
第三方应用在接入SDK时不需要判断是否安装QQ、TIM。若有判断安装QQ、TIM的逻辑建议移除。
*/
+ (BOOL)isTIMInstalled;
/**
检测QQ是否支持API调用
\return 如果当前安装QQ版本支持API调用则返回YES,否则返回NO
*/
+ (BOOL)isQQSupportApi;
/**
检测TIM是否支持API调用
\return 如果当前安装TIM版本支持API调用则返回YES,否则返回NO
*/
+ (BOOL)isTIMSupportApi __attribute__((deprecated("已过期, 建议删除调用,调用地方用YES替代。")));
/**
检测是否支持分享
\return 如果当前已安装QQ且QQ版本支持API调用 或者 当前已安装TIM且TIM版本支持API调用则返回YES,否则返回NO
*/
+ (BOOL)isSupportShareToQQ;
/**
检测是否支持分享到QQ结合版QZone
\return 如果当前已安装QQ且QQ版本支持API调用则返回YES,否则返回NO
*/
+ (BOOL)isSupportPushToQZone;
/**
启动QQ
\return 成功返回YES,否则返回NO
*/
+ (BOOL)openQQ;
/**
启动TIM
\return 成功返回YES,否则返回NO
*/
+ (BOOL)openTIM;
/**
获取QQ下载地址
如果App通过<code>QQApiInterface#isQQInstalled</code>和<code>QQApiInterface#isQQSupportApi</code>检测发现QQ没安装或当前版本QQ不支持API调用,可引导用户通过打开此链接下载最新版QQ。
\return iPhoneQQ下载地址
*/
+ (NSString *)getQQInstallUrl;
/**
获取TIM下载地址
如果App通过<code>QQApiInterface#isTIMInstalled</code>检测发现TIM没安装或当前版本TIM不支持API调用,可引导用户通过打开此链接下载最新版TIM。
\return iPhoneTIM下载地址
*/
+ (NSString *)getTIMInstallUrl;
@end
//
// GMPopupBgView.h
// Gengmei
//
// Created by wangyang on 2018/3/2.
// Copyright © 2018年 更美互动信息科技有限公司. All rights reserved.
//
#import <GMKit/GMKit-umbrella.h>
@protocol GMPopupBgViewDelegate <NSObject>
@optional
- (void)popupBgViewDidDismiss;
- (void)didCompletedAnimation;
@end
typedef NS_ENUM(NSUInteger, GMPopupAnimationType) {
GMPopupAnimationTypeNone = 0,
GMPopupAnimationTypeFade,
// 从底部滑出(默认)
GMPopupAnimationTypeFlipFromBottom,
// 从中心立即显示并做弹簧动画
GMPopupAnimationTypeSpringScaleFromCenter,
// 自定义
GMPopupAnimationTypeCustom = 100,
};
/**
所有使用半透明背景的popView,都使用该Class作为父类
*/
@interface GMPopupBgView : GMView<UIGestureRecognizerDelegate>
// 半透明背景颜色。默认是[UIColor colorWithWhite:0 alpha:0.6]
@property (nonatomic, strong) UIColor *bgAlphaColor;
@property (nonatomic, weak) id<GMPopupBgViewDelegate> delegate;
/**
container的背景颜色,位置(坐标或者约束)是可以自定义的。
container的大小可以使用约束自动计算,也可以显示的设置size
*/
@property (nonatomic, strong) UIView *container;
/**
点击空白区域不隐藏视图
*/
@property (nonatomic, assign) BOOL disableCancelTouch;
/**
使用 GMPopupAnimationTypeCustom 时,可以自定义container的动画。默认为 GMPopupAnimationTypeFlipFromBottom
自定义动画必须在 containerShowAnimation 与 containerHideAnimation 中实现
*/
@property (nonatomic, assign) GMPopupAnimationType animationType;
// 默认是0.3秒
@property (nonatomic, assign) CGFloat animationDuration;
@property (nonatomic, copy) void (^containerShowAnimation) (GMPopupBgView *bgView, CGFloat duration);
@property (nonatomic, copy) void (^containerHideAnimation) (GMPopupBgView *bgView, CGFloat duration);
/**
点击半透明背景会触发该方法隐藏,执行隐藏动画,然后removeFromSuperview。
注意:不会调用delegate.popupBgViewDidDismiss()
*/
- (void)hide;
- (void)didTapView;
@end
//
// GMPopupBgView.m
// Gengmei
//
// Created by wangyang on 2018/3/2.
// Copyright © 2018年 更美互动信息科技有限公司. All rights reserved.
//
#import "GMPopupBgView.h"
@interface GMPopupBgView () <UIGestureRecognizerDelegate>
@end
@implementation GMPopupBgView
- (void)setup {
[super setup];
self.frame = CGRectMake(0, 0, MAINSCREEN_WIDTH, MAINSCREEN_HEIGHT);
self.animationDuration = 0.3;
self.animationType = GMPopupAnimationTypeFlipFromBottom;
self.bgAlphaColor = [UIColor colorWithWhite:0 alpha:0.6];
self.backgroundColor = [UIColor colorWithWhite:0 alpha:0];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapView)];
tap.delegate = self;
[self addGestureRecognizer:tap];
tap.delegate = self;
self.userInteractionEnabled = YES;
_container = [[UIView alloc] initWithFrame:CGRectMake(0, MAINSCREEN_HEIGHT, MAINSCREEN_WIDTH, 322)];
_container.backgroundColor = [UIColor whiteColor];
[self addSubview:_container];
}
- (void)didTapView {
[self hide];
if ([self.delegate respondsToSelector:@selector(popupBgViewDidDismiss)]) {
[self.delegate popupBgViewDidDismiss];
}
}
- (void)willMoveToSuperview:(UIView *)newSuperview {
if (newSuperview == nil) {
return;
}
switch (self.animationType) {
case GMPopupAnimationTypeNone: {
self.backgroundColor = self.bgAlphaColor;
break;
}
case GMPopupAnimationTypeFade: {
self.backgroundColor = self.bgAlphaColor;
self.container.alpha = 0;
[self animation:^{
self.container.alpha = 1;
}];
break;
}
case GMPopupAnimationTypeFlipFromBottom: {
[self animation:^{
self.container.bottom = MAINSCREEN_HEIGHT;
self.backgroundColor = self.bgAlphaColor;
}];
break;
}
case GMPopupAnimationTypeSpringScaleFromCenter: {
[self animation:^{
self.backgroundColor = self.bgAlphaColor;
}];
self.container.transform = CGAffineTransformMakeScale(0.7, 0.7);
[UIView animateWithDuration:self.animationDuration delay:0 usingSpringWithDamping:0.3 initialSpringVelocity:0 options:0 animations:^{
// 放大
self.container.transform = CGAffineTransformMakeScale(1, 1);
} completion:nil];
break;
}
case GMPopupAnimationTypeCustom: {
[self animation:^{
self.backgroundColor = self.bgAlphaColor;
}];
self.containerShowAnimation(self, self.animationDuration);
break;
}
default:
break;
}
}
- (void)hide {
[UIView animateWithDuration:self.animationDuration animations:^{
self.backgroundColor = [UIColor colorWithWhite:0 alpha:0];
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
switch (self.animationType) {
case GMPopupAnimationTypeNone:
case GMPopupAnimationTypeFade: {
[self animation:^{
self.container.alpha = 0;
}];
break;
}
case GMPopupAnimationTypeFlipFromBottom: {
[self animation:^{
self.container.top = MAINSCREEN_HEIGHT;
}];
break;
}
case GMPopupAnimationTypeSpringScaleFromCenter: {
[self animation:^{
self.container.alpha = 0;
}];
break;
}
case GMPopupAnimationTypeCustom: {
self.containerHideAnimation(self, self.animationDuration);
break;
}
default:
break;
}
}
- (void)animation:(void (^)(void))block {
[UIView animateWithDuration:self.animationDuration animations:^{
block();
} completion:^(BOOL finished) {
if ([self.delegate respondsToSelector:@selector(didCompletedAnimation)]) {
[self.delegate didCompletedAnimation];
}
}];
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer shouldReceiveTouch:(UITouch*)touch {
// 如果点击了container区域, 不需要响应手势
if (CGRectContainsPoint(self.container.frame, [touch locationInView:self])) {
return NO;
} else if (self.disableCancelTouch) {
return NO;
} else {
return YES;
}
}
@end
//
// GMSafeValue.h
// Gengmei
//
// Created by wangyang on 2017/1/17.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import <Foundation/Foundation.h>
#define SafeValue(someValue) [GMSafeValue safeValue:someValue]
#define SafeString(str) [GMSafeValue safeString:str]
#define SafeNumber(num) [GMSafeValue safeNumber:num]
#define NullableString(str) [GMSafeValue nullableString:str]
#define NullableNumber(num) [GMSafeValue nullableNumber:num]
NS_ASSUME_NONNULL_BEGIN
@interface GMSafeValue : NSObject
+ (nonnull id)safeValue:(id)object;
/*手动从字典中解析string或者number时使用下面4个方法*/
+ (nonnull NSString *)safeString:(id)str;
+ (nonnull NSNumber *)safeNumber:(id)num;
+ (nullable NSString *)nullableString:(id)str;
+ (nullable NSNumber *)nullableNumber:(id)num;
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
//
// UIImage+Compress.h
// Gengmei
//
// Created by 朱璇 on 2018/11/15.
// Copyright © 2018年 更美互动信息科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (Compress)
// 将图片按指定大小压缩
+ (NSData *)compressImage:(UIImage *)image toByte:(NSUInteger)maxLength size:(CGSize)size;
@end
This diff is collapsed.
//
// UIView+SafeArea.h
// Gengmei
//
// Created by wangyang on 2018/6/19.
// Copyright © 2018年 更美互动信息科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (SafeArea)
@property (nonatomic, readonly, class) CGFloat safeAreaInsetsBottom;
@end
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment