Skip to content

Instantly share code, notes, and snippets.

View yogeshpaliyal's full-sized avatar
♥️
Open Sourcing

Yogesh Choudhary Paliyal yogeshpaliyal

♥️
Open Sourcing
View GitHub Profile
View iosInAppPurchase.md

iOS In App Purchase

  1. Create app and products on App store.
  2. Fill tax, bank and agreements(free and paid).
  3. App side work. A. Use StoreKit (It will create local environment, no need to create sandbox account for this and you cannot verify receipt of this on server.) B. Old way.
  • Create sandbox account on itunes connect.
  • Query all purchase able items.
  • Purchase item (you will get popup to enter email and password, enter credentials of sandbox account)
@yogeshpaliyal
yogeshpaliyal / CustomBottomSheet.kt
Created November 15, 2021 19:07
Show full screen bottom sheet
View CustomBottomSheet.kt
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val dialog = super.onCreateDialog(savedInstanceState)
dialog.setOnShowListener { dialogInterface ->
dialog.window?.findViewById<View>(R.id.design_bottom_sheet)?.let { bottomSheetView ->
bottomSheetView.background = null
/* bottomSheetView.let {
BottomSheetBehavior.from(it).isFitToContents = true
BottomSheetBehavior.from(it).state = BottomSheetBehavior.STATE_EXPANDED
}*/
val bottomSheetDialog = dialogInterface as BottomSheetDialog
@yogeshpaliyal
yogeshpaliyal / Resource.kt
Created June 23, 2021 15:04
Wrapper class for Data and Status
View Resource.kt
/**
* @author Yogesh Paliyal
* Created Date : 15 October 2020
*/
data class Resource<out T>(val status: Status, val data: T?, val message: String?) {
companion object {
fun <T> success(data: T?, message: String?= ""): Resource<T> {
return Resource(Status.SUCCESS, data, message)
@yogeshpaliyal
yogeshpaliyal / AutCaller.kt
Last active June 23, 2021 15:00
Base Caller to work with coroutines
View AutCaller.kt
class AuthCaller : BaseCaller(){
fun login(email: String, password: String): Resource<BaseApiModel>{
return hitApi(Apis.LOGIN, HashMap<String,String>().apply{
put("email",email)
put("password",password)
})
}
}
@yogeshpaliyal
yogeshpaliyal / Loading Listing.kt
Created October 29, 2020 15:57
Universal RecyclerView Adapters Initialize
View Loading Listing.kt
private val mAdapter by lazy {
UniversalRecyclerAdapter<UserModel>(
R.layout.item_user,
resourceShimmer = R.layout.layout_loading_full_page,
defaultShimmerItems = 1,
mListener = object : BasicListener<UserModel> {
override fun onClick(model: UserModel) {
Toast.makeText(this@LoadingListingActivity, model.name, Toast.LENGTH_SHORT)
.show()
}