- made the category collection cells dynamic - handled the category selection will call the episode api - solved activity indicator view at the splash start-up - handled the app lifecycle for live tv app going in foreground and background - handled play pause while the live tv view apperas and disappears - Made the likes and favourites dynamic on episode screen
111 lines
4.1 KiB
Swift
111 lines
4.1 KiB
Swift
//
|
|
// APIEndPoints.swift
|
|
// WOKA
|
|
//
|
|
// Created by MacBook Pro on 06/05/24.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
// enum to check envirnments
|
|
enum EnvironmentCheck{
|
|
case staging
|
|
case production
|
|
}
|
|
|
|
struct APIEndPoints {
|
|
|
|
// Private init to prevent external initialization
|
|
private init() {}
|
|
|
|
struct BaseURL {
|
|
static let staging = "https://wokaland.com/admin/api/"
|
|
static let production = "https://simplitend.com"
|
|
}
|
|
|
|
struct Auth {
|
|
static let check_exist_email = makeURL(path: "check_exist_email")
|
|
|
|
/*
|
|
Login User
|
|
*/
|
|
static let login = makeURL(path: "login")
|
|
static let login_proceed = makeURL(path: "login_proceed")
|
|
static let guest_login = makeURL(path: "guest_login")
|
|
|
|
|
|
static let user_email_verification = makeURL(path: "user_email_verification")
|
|
static let validate_otp = makeURL(path: "validate_otp")
|
|
static let interest_topic_listing = makeURL(path: "interest_topic_listing")
|
|
static let check_exist_username = makeURL(path: "check_exist_username")
|
|
static let avatar_listing = makeURL(path: "avatar_listing")
|
|
static let child_registration = makeURL(path: "child_registration")
|
|
static let get_linked_child = makeURL(path: "get_linked_child")
|
|
|
|
/*
|
|
Password forgot api's
|
|
*/
|
|
static let forgot_password_send_otp = makeURL(path: "forgot_password_send_otp")
|
|
static let forgot_password_verify_otp = makeURL(path: "forgot_password_verify_otp")
|
|
static let update_password = makeURL(path: "update_password")
|
|
|
|
/*
|
|
UserData
|
|
*/
|
|
static let get_user_data = makeURL(path: "get_user_data")
|
|
}
|
|
|
|
struct SideBarNav{
|
|
static let faq_listing = makeURL(path: "faq_listing")
|
|
static let user_queries_store = makeURL(path: "user_queries_store")
|
|
static let guest_queries_store = makeURL(path: "guest_queries_store")
|
|
static let update_profile = makeURL(path: "update_profile")
|
|
static let user_logout = makeURL(path: "user_logout")
|
|
static let user_deactivate_account = makeURL(path: "user_deactivate_account")
|
|
}
|
|
|
|
struct Home{
|
|
static let blogs = makeURL(path: "blogs")
|
|
static let song_listing = makeURL(path: "song_listing")
|
|
static let get_user_notifications = makeURL(path: "get_user_notifications")
|
|
static let favourite_listing = makeURL(path: "favourite_listing")
|
|
|
|
//Post Like Unlike
|
|
static let post_like = makeURL(path: "post_like")
|
|
static let post_unlike = makeURL(path: "post_unlike")
|
|
|
|
// Favourite
|
|
static let favourite_remove = makeURL(path: "favourite_remove")
|
|
static let favourite_add = makeURL(path: "favourite_add")
|
|
}
|
|
|
|
struct WebSeries{
|
|
static let continue_watching = makeURL(path: "continue_watching")
|
|
static let watch_show_listing = makeURL(path: "watch_show_listing")
|
|
static let category_listing = makeURL(path: "category_listing")
|
|
static let season_listing = makeURL(path: "season_listing")
|
|
static let season_episode_listing = makeURL(path: "season_episode_listing")
|
|
}
|
|
|
|
// Other endpoint categories...
|
|
struct Links {
|
|
static let privacyPolicy = "https://www.wokaland.com/privacy-policy/"
|
|
static let termsAndCondition = "https://www.wokaland.com/terms/"
|
|
// Other links...
|
|
}
|
|
|
|
// Helper method to construct full URL from base URL and path
|
|
private static func makeURL(path: String) -> URL {
|
|
guard let baseURL = baseURLForCurrentEnvironment() else {
|
|
fatalError("Base URL not configured for current environment")
|
|
}
|
|
return baseURL.appendingPathComponent(path)
|
|
}
|
|
|
|
// Helper method to get base URL based on current environment
|
|
private static func baseURLForCurrentEnvironment() -> URL? {
|
|
// Determine environment (e.g., staging, production) and return appropriate base URL
|
|
return URL(string: BaseURL.staging)
|
|
}
|
|
}
|