Instamojo / ios-sdk

Instamojo Payment Integration for iOS
https://docs.instamojo.com/page/ios-sdk
GNU Lesser General Public License v3.0
6 stars 13 forks source link

Instamojo Integration in Swift #34

Open Devloperios opened 5 years ago

Devloperios commented 5 years ago

Hello,

How to Integrate a Instamojo Payment Gatway In Swift Using This IOS Sdk. i don't know how to integrat this IOS Sdk. anyone is Know. then help me.

cybenauts commented 5 years ago

After several days I found a solution the the existing issue (build on latest version of Xcode/Swift), follow the instructions below - 1- Install the pod from (https://docs.instamojo.com/page/ios-sdk) into your Project 2- Close the project and download the Git folder from (https://github.com/Instamojo/ios-sdk) 3- Unzip & open the folder & delete Instamojo.framework 4- Now open the Instamojo workspace in the latest version of Xcode 5- Build for any simulator (select any simulator and build) (if faced with issues like pod not found goto Project->Targets->Build Phases->Remove and re-add linked binaries i.e pod file) 6- Build for Generic iOS Device 7- Goto Build Phases & add the Run Script

UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal

if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"

xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos  BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build

cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/"

cp -R "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule/." "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule"

lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}"

cp -R "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}"

open "${PROJECT_DIR}"

fi

8- Build again, this will open your Instamojo folder locate Instamojo.framework copy it. 9- Go to your project -> Pods->Instamojo replace Instamojo.framework 10- Now clean & build your project, after this you can run your project on any simulator/device.